[ale] Question about how to do something from bash to csh.

Michael H. Warfield mhw at WittsEnd.com
Fri May 28 14:29:22 EDT 2010


On Thu, 2010-05-27 at 22:42 -0400, Chuck Payne wrote: 
> Guys,
> 
> I have never worked in csh. Something that I do all the time bash, I
> have no clue do in csh...

OMG it's been ages since I've even looked at csh.  Not even sure WHY
anyone would need to do this in csh, but...

> Here is my bash one liner.

> for i in `cat deadmail` : do postsuper -d $i ; postfix reload ; done ;
> 
> 
> Can someone show me how to do that in csh, I know that you are to use
> foreach, but get it Illegal variable name.

> Here what I have tried on my own...

> foreach i $(cat deadmail) postsuper -d $ end

First...  It can't be on one line.  According to the man page "Both
foreach and end must appear alone on separate lines."  You also don't
want to be doing the $() notation for execution.  Use backticks.  Then
the word list must be contained in parens.

This should work:

foreach i (`cat deadmail`)
postsuper -d $i
end

> sorry for a nood question on csh



-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
Url : http://mail.ale.org/pipermail/ale/attachments/20100528/7b63b003/attachment.bin 


More information about the Ale mailing list