How to put a string (w/ dbl & sgl quotes) into a pipe without it being changed ?
If I want to put:
Code:
"three's" > 4/5! |
?
Is this something you want to do in a shell script or in a C/C++ application?
I don't really understand the purpose of your project, but I would guess that you can send anything through a pipe, but to get meaningful results it all depends on the application at the receiving end of the pipe. Linux Archive |
Any number of applications, but I use mplayer as an example.
I have the file: Mplayer is running in slave mode and getting stdin from a fifo. Normally (i.e. without a fifo) you would run mplayer in slave mode, then type: Code:
loadfile /home/user/music/Beck\ -\ \"Sea Change\"\ -\ it\'s\ all\ in\ your\ mind.aac But now I have to put that string into a pipe, and bloody "echo" or some such bloody thing keeps de-escaping my quotes. I want to be able to do this in a script, so I can manually separate filenames at points with quotes in them. Or I could, but this would start to get very kludgey and bloated. So, as posted, I want to send the above string into a fifo, and come out EXACTLY the same, escaped quotes and all. |
Have you tried double escape (\\) ?
|
Quote the whole string, then put backslashes in
front of the inner quotes and the exclamation. $ mknod fifo p $ echo "\"three's\" > 4/5\!" > fifo |
Quote:
Code:
xxx'yyy\"zzz Code:
echo "\"xxx'yyy\"zzz" > fifo |
Where is your data coming from? and how are you feeding
it to the FIFO? You may need more than the two backslashes [I]chrism01]/I] suggested, at least three \\ to escape the backslash, and \" to escape the quote. |
$ mknod fifo p
$data='"three's" > 4/5!' $ echo $data > fifo This might solve. |
Quote:
echo "$data" and echo $data can have very different results on white space characters. |
All times are GMT -5. The time now is 06:05 AM. |