home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!cs.utexas.edu!natinst.com!news.dell.com!lupus.dell.com!mikepb
- From: mikepb@lupus.dell.com (Michael P. Brininstool)
- Subject: Re: wanted: tutorial about sh programming
- Message-ID: <1992Dec28.224149.12534@raid.dell.com>
- Sender: news@raid.dell.com (Net News Admin)
- Nntp-Posting-Host: lupus.dell.com
- Reply-To: mikepb@lupus.dell.com
- Organization: Dell UNIX Support
- References: <1992Dec23.161830.20091@Celestial.COM> <1992Dec23.191853.24899@nosc.mil>
- Date: Mon, 28 Dec 1992 22:41:49 GMT
- Lines: 19
-
- In article <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?
-
- Try something like this:
-
- echo "$system $hostid" | \
- awk '{printf("Hostname is %-8s Host id is %5s\n",$1,$2)}'
-
- ----------------------------------------------------------------------------|
- | Michael P. Brininstool DELL UNIX PRODUCT SUPPORT mikepb@lupus.dell.com |
- |----------------------------------------------------------------------------
-