Thread View: comp.unix.programmer
2 messages
2 total messages
Started by Johnny Szeto
Sat, 22 Sep 1990 22:17
<<eof ..... eof questions
Author: 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?
Re: <<eof ..... eof questions
Author: Dan Bernstein
Date: Sun, 23 Sep 1990 20:40
Date: Sun, 23 Sep 1990 20:40
8 lines
633 bytes
633 bytes
In article <12126@chaph.usc.edu> szeto@aludra.usc.edu (Johnny Szeto) writes: > ? set g=`sed 's/\(.*\)2/\1/'<<fg > ? $r[$b] > ? fg` The easiest solution (unfortunately) is `echo "$r[$b]" | sed`. ---Dan
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads