Hi,
does anyone know how to get the last characters of a string?
in bash.
Thanks
Search found 212 matches
- Sun Sep 02, 2018 7:11 pm
- Forum: Shell
- Topic: Bash last char of a string
- Replies: 2
- Views: 82503
- Tue Aug 28, 2018 4:03 pm
- Forum: MySQL
- Topic: SOLVED: mysql table is marked as crashed and should be repaired
- Replies: 4
- Views: 109502
Re: mysql table is marked as crashed and should be repaired
The simple answer :
if you want more information:
https://dev.mysql.com/doc/refman/8.0/en ... table.html
or
http://dev.mysql.com/doc/refman/5.0/en/ ... epair.html
Code: Select all
REPAIR TABLE tablename
https://dev.mysql.com/doc/refman/8.0/en ... table.html
or
http://dev.mysql.com/doc/refman/5.0/en/ ... epair.html
- Tue Aug 14, 2018 8:23 pm
- Forum: Postfix
- Topic: postfix forward mail to multiple recipients
- Replies: 2
- Views: 99192
Re: postfix forward mail to multiple recipients
Yes it possible.
Separate the emails with comas.
Edit the file /etc/postfix/vmail_aliases
Separate the emails with comas.
Edit the file /etc/postfix/vmail_aliases
Code: Select all
group@domain.com bob@domain.com,alice@domain.com
- Mon May 07, 2018 6:17 pm
- Forum: PHP
- Topic: SOLVED: PHP file_put_contents not writing to /tmp
- Replies: 1
- Views: 55931
Re: PHP file_put_contents not writing to /tmp
Found the solution:
Apache/php now create a directory in /imp which hold the /tmp/file.tmp
So it doesn't write directly to /tmp.
Makes it more difficult to read it by another script
Apache/php now create a directory in /imp which hold the /tmp/file.tmp
Code: Select all
/tmp/systemd-private-9b5e7c68bxxx45faa1a812b5df02f1ab-apache2.service-5ExxRI/tmp/
Makes it more difficult to read it by another script

- Sun May 06, 2018 8:22 pm
- Forum: PHP
- Topic: SOLVED: PHP file_put_contents not writing to /tmp
- Replies: 1
- Views: 55931
SOLVED: PHP file_put_contents not writing to /tmp
I have a php script that writes to /tmp directory
But it doesn't write, I can't find the files.
I also don't get errors (php or in apache)
Anyone got any ideas ?
Code: Select all
file_put_contents('/tmp/file.tmp',$value);
I also don't get errors (php or in apache)
Anyone got any ideas ?
- Fri Feb 09, 2018 9:52 pm
- Forum: SQL
- Topic: SOLVED: update query update from another table
- Replies: 2
- Views: 70400
Re: update query update from another table
Yes, you can with update:
here is an example:
here is an example:
Code: Select all
UPDATE update_table AS a, source_table AS b SET a.update_column=b.source_table WHERE a.id=b.id;
- Sat Feb 03, 2018 9:25 pm
- Forum: HTML
- Topic: HTML CSS show li items in multiple columns
- Replies: 1
- Views: 63658
Re: HTML CSS show li items in multiple columns
You can use CSS and set inline-block ( with fixed width )
It will set the Li-element next to each other,
and with fixed-width it will look like columns.
li {display: inline-block; width:200px;}
You can also play with the following in CSS,
but the support depends on browser.
columns: 2 ...
It will set the Li-element next to each other,
and with fixed-width it will look like columns.
li {display: inline-block; width:200px;}
You can also play with the following in CSS,
but the support depends on browser.
columns: 2 ...
- Tue Jan 30, 2018 8:44 pm
- Forum: SQL
- Topic: SOLVED : Drop table fails
- Replies: 2
- Views: 63585
Re: Drop table fails
The foreign key is actually on another table;
Use this command to find it:
SELECT * FROM information_schema.table_constraints WHERE constraint_schema = 'DATABASE_NAME' AND constraint_type = 'FOREIGN KEY' ;
Once you find it, you can remove it on that table:
ALTER TABLE other_table DROP FOREIGN ...
Use this command to find it:
SELECT * FROM information_schema.table_constraints WHERE constraint_schema = 'DATABASE_NAME' AND constraint_type = 'FOREIGN KEY' ;
Once you find it, you can remove it on that table:
ALTER TABLE other_table DROP FOREIGN ...
- Thu Jan 11, 2018 2:56 pm
- Forum: Shell
- Topic: SOLVED : Bash remove trailing digits
- Replies: 2
- Views: 72715
Re: Bash remove trailing digits
Thanks that is what I was looking for 

- Tue Jan 09, 2018 10:06 pm
- Forum: Shell
- Topic: SOLVED : Bash remove trailing digits
- Replies: 2
- Views: 72715
Re: Bash remove trailing digits
You can use
But this will remove all digits not only at the end.
Better is to use sed
Code: Select all
VARIABLE="test 556";
VARIABLE=${VARIABLE//[0-9]/};
Better is to use sed
Code: Select all
VARIABLE=`echo $VARIABLE | sed -e 's/[0-9]*$//g'`;