insert a symbol with sed
hello,
I've a variable which return the 5th field in a ligne. var=`echo $i | cut -d";" -f5` it returns: 1234 4512 ... I want to insert a ":" in the middle of each number like : 12:34 45:12 i tried whith sed, but i 've an error. Thnks for your help |
Code:
toni@mario:~$ echo -e '1234\n4567' | sed 's/^\(..\)\(..\)$/\1:\2/' |
hello,
thanks for your help i've a messag error ( sed : command garbled 's/^\(..\)\(..\)$/\1:\2/' ) what it means? thanks |
Did you try that exact command I used?
Are you having what versions of of bash and sed? Code:
toni@mario:~$ echo $SHELL, $BASH_VERSION |
hello
it's a sun solaris 5.8 thanks |
ToniT's script works with Solaris 8:
Code:
$ uname -s -r |
All times are GMT -5. The time now is 01:07 AM. |