Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!spool.mu.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!jik From: jik@athena.mit.edu (Jonathan I. Kamens) Newsgroups: comp.unix.shell Subject: Re: remote shells Message-ID: <1991Apr3.211742.22897@athena.mit.edu> Date: 3 Apr 91 21:17:42 GMT References: <3688@ux.acs.umn.edu> Sender: news@athena.mit.edu (News system) Organization: Massachusetts Institute of Technology Lines: 28 In article <3688@ux.acs.umn.edu>, edh@ux.acs.umn.edu (Merlinus Ambrosius) writes: |> #!/bin/sh |> RHOST=apple-gunkies |> rsh $RHOST 'echo here I am on $RHOST!' Use double quotes instead of single quotes. variable substitutions occur inside double quotes, but not inside single quotes. Observe: % /bin/sh $ RHOST=apple-gunkies $ echo "here I am on $RHOST!" here I am on apple-gunkies! $ echo 'here I am on $RHOST' here I am on $RHOST Quoting from our sh(1): A character may be quoted by preceding it with a \. \new- line is ignored. All characters enclosed between a pair of quote marks (''), except a single quote, are quoted. Inside double quotes ("") parameter and command substitution occurs and \ quotes the characters \ ' " and $. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710