I am looking an neat trick / elegant solution to
manipulate / modify hostname and set a variable to the
value inside a script. I have figured what I want to do.
I just want to know how to set the variable correctly ?
Say my host name is 'machine005' (w/o single quotes)
So the hostname command would be
fine. If I want to change the first '0' to a '9' then
So I would like to set the command string in bold
above to be the value of a variable inside a string.
Does the following do this
setenv VAR "hostname|sed \'s/0/9/\'"
It seems that Double/Single quotes don't play nice
together. So I am trying to figure this out.
Any assistance would be appreciated.