home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!nwnexus!Celestial.COM!ray
- From: ray@Celestial.COM (Ray Jones)
- Subject: Re: wanted: tutorial about sh programming
- Organization: Celestial Software, Mercer Island, WA
- Date: Sat, 26 Dec 1992 21:03:09 GMT
- Message-ID: <1992Dec26.210309.11538@Celestial.COM>
- References: <1992Dec23.161830.20091@Celestial.COM> <1992Dec23.191853.24899@nosc.mil>
- Lines: 29
-
- In <1992Dec23.191853.24899@nosc.mil> mcdono@nosc.mil (Tim McDonough CSC Room 191 Phone 553 3102 ) writes:
-
-
- >I'd like the following line to produce the output below it.
-
- >echo "Hostname is " $system " Host id is " $hostid
-
- >Hostname is foo Host id is 78454
- >Hostname is fooobar Host id is 89000
-
- >I tried removing the quotes to no avail, any ideas?
- >mcdono@sunspot.nosc.mil
- Assuming $system and $hostid vars are set,
-
- echo "Hostname is $system Host id is $hostid"
-
- should do the trick. Variables will be replace inside double quotes,
- however, not inside single quotes. Therefore;
-
- echo 'Hostname is $system Host id is $hostid'
-
- will produce,
-
- Hostname is $system Host id is $hostid
- --
- INTERNET: ray@Celestial.COM Ray A. Jones; Celestial Software
- UUCP: ...!thebes!camco!ray 6641 East Mercer Way
- uunet!camco!ray Mercer Island, WA 98040; (206) 947-5591
- The probability of one or more spelling errors in this missive approaches
-