cat file with $variable
How do I get my newtest.sh to have the 2 lines below?
cat >> /tmp/newtest.sh << EOF1 HostLoc="$(echo "$HostName" |awk '{print substr($0,"1",4)}')"; HostLoc='"$(echo "$HostName" |awk '{print substr($0,"1",4)}')"'; EOF1 Actual results is HostLoc=""; HostLoc='""'; Thanks in advance |
try to add quotes to the delimeter
Code:
cat >> /tmp/newtest.sh << 'EOF1' |
You sure the variable HostName contains a non-null string?
|
Quote:
Cheers, Tink P.S.: Beat by a few seconds ;D |
Try $HOSTNAME (note uppercase)
|
solved
'EOF' did the tricks thanks konsolebox
|
Quote:
|
All times are GMT -5. The time now is 08:24 PM. |