echo “e_ff_0123_1″ | awk -F_ ‘{print $1″_”$2″_”$3″_0″$4}’
November 17, 2008
October 14, 2008
Select the end of a chain
#:~$ toto="bonjour le monde"
#:~$ echo ${toto:$((${#toto}-10))}
r le monde
${var:x} : extract sub chain of $var from char n° x to the end.
$((….)) : allow to do calculation
September 24, 2008
Create a multi tar with specified size
Create a tar file:
tar cvf - gaim/ | split -b 1024k - gaim.tar ll gaim.tar* -rw-r--r-- 1 root root 1048576 Jan 29 16:57 gaim.taraa -rw-r--r-- 1 root root 1048576 Jan 29 16:57 gaim.tarab -rw-r--r-- 1 root root 1048576 Jan 29 16:57 gaim.tarac -rw-r--r-- 1 root root 1048576 Jan 29 16:57 gaim.tarad -rw-r--r-- 1 root root 1048576 Jan 29 16:57 gaim.tarae -rw-r--r-- 1 root root 225280 Jan 29 16:57 gaim.taraf
To read it :
cat gaim.tar* | tar tvf -
SIZE may have a multiplier suffix: b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024, GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z,Y.