home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.shell
- Path: sparky!uunet!news.larc.nasa.gov!hal.larc.nasa.gov!alan
- From: alan@hal.larc.nasa.gov (alan dare)
- Subject: awk & echo under bourne
- Message-ID: <BuL1Dp.FAA@news.larc.nasa.gov>
- Originator: alan@hal.larc.nasa.gov
- Sender: news@news.larc.nasa.gov (USENET Network News)
- Organization: NASA Langley Research Center, Hampton, VA USA
- Date: Mon, 14 Sep 1992 19:13:00 GMT
- Lines: 28
-
-
- I have a question on echo'ing and awk under the bourne shell.
-
- First the awk question:
-
- num=`grep NUM_OF_DISPLAYS displays.h| cut -d" " -f3`
- cat display_table.h |awk '$2 == $num {print $0}' >> temp
-
- The variable num is set from looking into one file. The value of this
- variable resides in the second column on one line in a different file. I
- want to access this with awk, but I cant get awk to resolve the value of num.
- Can awk access my shell variable?
-
- The echo'ing question:
-
- junk="start"
- echo "finish_$junk" # Works
- echo "$junk_finish" # Doesn't work
-
- How do I get "start_finish" using only one echo (using two echos and "\c"
- has caused me some problems when its used to pipe into another command)?
-
- Thanks for any and all help
- --
-
- *********************************************************************
- Alan Dare | Internet : alan@hal.larc.nasa.gov
- NASA Langley Research Center |
-