Article View: comp.unix.programmer
Article #891<<eof ..... eof questions
From: Johnny Szeto
Date: Sat, 22 Sep 1990 22:17
Date: Sat, 22 Sep 1990 22:17
25 lines
1505 bytes
1505 bytes
There is a problem with an interactive shell command I try to use: [shakyamuni:54 :~] foreach i (*2) ? set g=`sed 's/\(.*\)2/\1/'<<fg ? $r[$b] ? fg` ? mv $i $g ? @ b++ ? end The above paragraph is typed on a current shell since I have to change some filenames in the current shell. On line two by the end of the sentence I try to use a here statement so that sed will execute the variable $r[$b] as a standard input typed at the terminal if I use < instead of << thru sed will take the stuff inside the variable, by the way the variable contains filename so sed will take everything inside the file as input rather the filename itself. But the problem is the command substitution quotes `` has to be on the same line since when I execute it it says unmatched `. I guess the problem is when I go to line 3 the shell gives me another subshell prompt so it apparently has already execute line 2 before I complete the `` command. I am quite a novice in programming C-shell. Can someone give me some guidance?
Technical Details
Message-ID:
<12126@chaph.usc.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!chaph.usc.edu!aludra.usc.edu!szetoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!chaph.usc.edu!aludra.usc.edu!szeto From: szeto@aludra.usc.edu (Johnny Szeto) Newsgroups: comp.unix.programmer Subject: <<eof ..... eof questions Message-ID: <12126@chaph.usc.edu> Date: 22 Sep 90 22:17:11 GMT Sender: news@chaph.usc.edu Distribution: usa Organization: University of Southern California, Los Angeles, CA Lines: 25 Nntp-Posting-Host: aludra.usc.edu Originator: szeto@aludra.usc.edu