trouble with quotation marks in c-shell script
Hello,
I'm writing a c-shell script in which I need to obtain the ip address of the person running the script and return it to a variable. I'm using the following command to obtain the ip:
echo $SSH_CLIENT | awk '//{print $1}'
The problem: the only way I'm know to save terminal output as a variable is by doing something like:
set variable = 'command'
So if I put "$SSH_CLIENT | awk '//{print $1}'" in for the command, then there are two sets of single quotation marks, one nested inside the other.
set variable = '$SSH_CLIENT | awk '//{print $1}''
And instead of recognizing them as such, linux assumes the second single quotation closes the first and the command doesn't work.
So how can I write the command so that linux will recognize that second quotation mark as being nested inside the first, as opposed to closing the first so that my command will work properly?
Thanks,
Matt
|