Hi, i'm having a very hard time trying to substitute \n with " " (i.e, substitute newline with double quotes-space-double quotes). Call it "escaping hell" if you get the pun
I've been through many man pages and google searches but still i can't get this straight. I tried perl, tr, bare regex - you name it!
This command is the best working yet:
cat pathlist | tr '\n' '" "' > pathlist2
but it just adds one single double quote:
/home/e633/Desktop/SSH config notes
/home/e633/Desktop/apache config notes
/home/e633/Desktop/uni"/home/e633/Desktop/network"/home/e633/Desktop/SSH config notes"/home/e633/Desktop/apache config notes"
instead i want it to be:
"/home/e633/Desktop/uni" "/home/e633/Desktop/network" "/home/e633/Desktop/SSH config notes" "/home/e633/Desktop/apache config notes"
So i can use this string for creating a 7zip archive. BTW that newline-separated string is from $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS, as i'm writing a nice user-friendly ubuntu script.