Quote:
|
This can be a big problem and I often run into this issue. However I can usially get around it by surrounding the command with a backquote "`"
This guide (page) has a good little section explaining the differences and behavors of single and double quotes along with escape characters and the super handy backquote that I had just mentioned and backslash which we all love. http://linuxreviews.org/beginner/Bas...O/en/x303.html |
The big problem is that variables are the shell's data structures. They are not designed for holding or executing commands. This includes, in particular, quote marks and other shell syntax characters.
I'm trying to put a command in a variable, but the complex cases always fail! http://mywiki.wooledge.org/BashFAQ/050 The proper solution is to define a shell function for the command, and avoid the whole issue. Code:
errmail() { Oh, and please use ***[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do not use quote tags, bolding, colors, "start/end" lines, or other creative techniques. |
All times are GMT -5. The time now is 01:57 PM. |