[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Question about how to do something from bash to csh.
- Subject: [ale] Question about how to do something from bash to csh.
- From: terrorpup at gmail.com (Chuck Payne)
- Date: Sun, 30 May 2010 17:06:44 -0400
- In-reply-to: <1275071362.8501.111.camel@localhost>
- References: <[email protected]> <1275071362.8501.111.camel@localhost>
On Fri, May 28, 2010 at 2:29 PM, Michael H. Warfield <mhw at wittsend.com> wrote:
> 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!
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>
Didn't work. I am getting this error...
#!/bin/csh
foreach i(`cat deadletters`)
/usr/local/sbin/postsuper -d $i
test: 3: Syntax error: "(" unexpected
--
-----------------------------------------
Discover it! Enjoy it! Share it! openSUSE Linux.
-----------------------------------------
openSUSE -- en.opensuse.org/User:Terrorpup
openSUSE Ambassador/openSUSE Member
skype,twiiter,identica,friendfeed -- terrorpup
freenode(irc) --terrorpup/lupinstein
Have you tried SUSE Studio? Need to create a Live CD, an app you want
to package and distribute , or create your own linux distro. Give SUSE
Studio a try. www.susestudio.com.