Article View: comp.unix.shell
Article #1222Re: <<eof .... eof questions
From: Paul John Falstad
Date: Sun, 23 Sep 1990 01:26
Date: Sun, 23 Sep 1990 01:26
28 lines
1155 bytes
1155 bytes
In article <12127@chaph.usc.edu> szeto@aludra.usc.edu (Johnny Szeto) writes:
>[shakyamuni:54 :~] foreach i (*2)
>? set g=`sed 's/\(.*\)2/\1/'<<fg
>? $r[$b]
>? fg`
>? mv $i $g
>? @ b++
>? end
If you must do this with csh, try something like this:
foreach i (*2)
set g=`echo $r[$b] | sed 's/\(.*\)2/\1/'`
mv $i $g
@ b++
end
I didn't bother to test it, but that's the general idea.
Also, you may want to try the 'shift' builtin rather than that
$r[$b], @ b++ stuff.
>I am quite a novice in programming C-shell. Can someone give me some
>guidance?
So am I, and I'd like to keep it that way. :-)
This is the silliest sketch I've ever been in!
Technical Details
Message-ID:
<2744@idunno.Princeton.EDU>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!udel!princeton!phoenix!pfalstadReferences:
<12127@chaph.usc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!wuarchive!udel!princeton!phoenix!pfalstad From: pfalstad@phoenix.Princeton.EDU (Paul John Falstad) Newsgroups: comp.unix.shell Subject: Re: <<eof .... eof questions Message-ID: <2744@idunno.Princeton.EDU> Date: 23 Sep 90 01:26:43 GMT References: <12127@chaph.usc.edu> Sender: news@idunno.Princeton.EDU Distribution: usa Organization: Princeton University, Princeton, New Jersey Lines: 28