SPUG: Inspired, broken.

Atom Powers atomic at wyrdtech.com
Wed Feb 9 13:27:48 PST 2005


>  
> AFTER:
> 
>>#perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt
> 
> By the way, does that #perl mean that you were running the command
> as root?  I wouldn't recommend that until you are more sure about
> what you're doing!
Yes, that was to indicate that I had tried to run it as root (using sudo).

Now I'm only slightly confused.
This doesn't work: ( I apologize for the line breaks )

apowers at hermes0:/home/mailman> sudo -u mailman perl5 -wnl -e 
'm/\w+\@\w+\.\w{3}/ and print "\L$&\E OK";' address_list.txt > 
recipients.txt
recipients.txt: Permission denied.

But this does:

apowers at hermes0:/usr/home/apowers> perl5 -wnl -e 'm/\w+\@\w+\.\w{3}/ and 
print "\L$&\E OK";' /usr/home/mailman/address_list.txt > recipients.txt

Is sudo dropping privileges back to 'apowers' when it sees the '>'?


More information about the spug-list mailing list