0:root@SERVER:/root # echo "something" | sed -e 's/^/\t/g'
tsomething
0:root@SERVER:/root #
AIX/ksh .. why doesn't it works? I just want to put a "tab" before every line!
aixkshsed
0:root@SERVER:/root # echo "something" | sed -e 's/^/\t/g'
tsomething
0:root@SERVER:/root #
AIX/ksh .. why doesn't it works? I just want to put a "tab" before every line!
Best Answer
\t
on the right hand side of ased
expression is not portable. Here are some possible solutions:POSIX shell
Bear in mind that since many shells store their strings internally as cstrings, if the input contains the null character (
\0
), it may cause the line to end prematurely.awk
Perl