sed with literal string–not input file

You have a single quotes conflict, so use:

 echo "A,B,C" | sed "s/,/','/g"

If using bash, you can do too (<<< is a here-string):

sed "s/,/','/g" <<< "A,B,C"

but not

sed "s/,/','/g"  "A,B,C"

because sed expect file(s) as argument(s)

EDIT:

if you use ksh or any other ones :

echo string | sed ...

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)