You are not logged in.
I have a variable that I'd like to assign that requires the string to be begin and end in both a single and double quote and I can't figure out how to do it. I think because of "variable expansion (is it?)" that bash is negating it. For example:
test='"string"'
echo $test
"string"
So obviously I try:
test=''"string"''
echo $test
Which is producing:
string
What I literally need the string to be is:
'"string"'
I haven't been able to find a way to do this. I know that this is unique. Does anyone know of a way to do this?
Last edited by Gen2ly (2012-01-10 18:30:30)
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline
test=\'\"string\"\'
echo $test
'"string"'
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Or if you want to risk going blind counting ticks
test="'"'"string"'"'"
echo $test
'"string"'
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
ohh, should have figured. Thanks for the help Trilby.
Setting Up a Scripting Environment | Proud donor to wikipedia - link
Offline