![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk to print ' (single quotes) | orahi001 | UNIX for Dummies Questions & Answers | 2 | 03-11-2008 04:30 PM |
| grep exclude/find single and double quotes | Lindy_so | UNIX for Dummies Questions & Answers | 4 | 03-06-2008 09:01 AM |
| echo using single quotes | chella | Shell Programming and Scripting | 3 | 10-29-2007 12:54 AM |
| Single v. double quotes in sed (GNU utilities for Win32 version) | daddydojo | Shell Programming and Scripting | 2 | 08-05-2007 05:26 PM |
| Checking Single Quotes in C | janemary.a | High Level Programming | 3 | 06-07-2007 02:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Double quotes or single quotes when using ssh?
I'm not very familiar with the ssh command. When I tried to set a variable and then echo its value on a remote machine via ssh, I found a problem. For example,
$ ITSME=itsme $ ssh xxx.xxxx.xxx.xxx "ITSME=itsyou; echo $ITSME" itsme $ ssh xxx.xxxx.xxx.xxx 'ITSME=itsyou; echo $ITSME' itsyou $ So what was going on here? Which satement was executed on remote machine and which one was on local system? I'm a little confused .... |
|
||||
|
So the two statements: ITSME=itsyou & echo $ITSME are both executed on remote host. But in the case of double quotes, variable will be evaluated first so the argument passed to ssh is actually ITSME=itsyou; echo itsme. While in the case of single quotes, no special characters survive. The argument passed to ssh is ITSME=itsyou; echo $ITSME. Understood, this is really an issue of command-line processing.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|