Re: [linux-392] csh won't run

From: Aaron D
Sent on: Sunday, May 11, 2008 11:49 PM
The problem is with line endings in unix and windows.  You are probably 
editing and saving in notepad.
run the following tr command to get rid of the \r you dont see in the file.
tr -d '\015' < rm_csh > rm_csh_new

--Aaron


chris wrote:
> Well proftpd should be your FTP *server*, I meant you
> should be able to set ASCII or BIN mode per transfer
> on your *client*.  When I was on windows we used
> ws-ftp or cuteftp, they should be able to
> automatically detect the filetype.
>
> Most of my machines don't even allow FTP these days
> though, so I use scp or rsync from UNIX hosts and
> don't worry about ASCII/BIN anymore.
>
> --- Michele <[address removed]> wrote:
>
>   
>> I looked at proftpd.conf, mentioned to me by Forest,
>> is says binary, but
>> sometimes I transfer binaries.  I don't know that I
>> would want to change
>> that.
>>
>> I'll just deal with the work around.
>>
>> -----Original Message-----
>> From: [address removed]
>> [mailto:[address removed]] On Behalf Of chris
>> Sent: Sunday, May 11, 2008 1:31 PM
>> To: [address removed]
>> Subject: RE: [linux-392] csh won't run
>>
>> Probably needs to be sent as ASCII instead of BIN,
>> since it's a plain text script.  But if it broke
>> suddenly I would be suspicious of a rouge filename
>> getting matched.
>>
>> --- Michele <[address removed]> wrote:
>>
>>     
>>> Well the script was in a bin with 700.
>>>
>>> I would have rewritten it a little, but I could
>>>       
>> get
>>     
>>> the thing working.
>>>
>>> It's a linux file transfer problem.
>>>
>>> For the life of me, I can't remember the trick I
>>> used to use to that.
>>>
>>>
>>> -----Original Message-----
>>> From: [address removed]
>>> [mailto:[address removed]] On Behalf Of chris
>>> Sent: Sunday, May 11, 2008 12:07 PM
>>> To: [address removed]
>>> Subject: Re: [linux-392] csh won't run
>>>
>>> Well you're getting an error from csh (the Usage
>>> error), so I don't think you deleted it.  Maybe
>>>       
>> you
>>     
>>> have a file with a space, quote, or other special
>>> character that is messing up the loop?
>>>
>>> I would also try to come up with a
>>>       
>> perl/python/ruby
>>     
>>> script that calls unlink() call directly, it will
>>> deal
>>> with unusual file names much better.  A malicious
>>> user
>>> could even leverage a shell script like that to
>>> wreck
>>> the system (like a file named 'foo\
>>>       
>> \/etc\/passwd\/
>>     
>>> _.jpg')
>>>
>>> --- Michele <[address removed]> wrote:
>>>
>>>       
>>>> I have a linux problem.  I was hoping someone
>>>>         
>> may
>>     
>>>> have encountered.  I don't
>>>> know where to start with this one.  I think it's
>>>>         
>>> an
>>>       
>>>> admin problem.
>>>>
>>>> I'm on a redhat linux web server.
>>>>
>>>> When I type csh, the prompt doesn't change to %.
>>>>         
>>>> Yesterday it did.
>>>>
>>>> I'm trying to run a a csh script.
>>>>
>>>> I wrote a shell script and it worked fine.
>>>>
>>>> The next time I log, I run the script "./rm_csh
>>>>         
>> ."
>>     
>>>> and get:
>>>>
>>>>         -'nknown option: `-
>>>>
>>>>         Usage: csh [ -bcdefilmnqstvVxX ] [
>>>>         
>>> argument
>>>       
>>>> ... ].
>>>>
>>>>  
>>>>
>>>> When I run the script "csh -f rm_csh .", I get:
>>>>
>>>> foreach: Words not parenthesized.
>>>>
>>>> I can't figure out what's going on.  The script
>>>> works fine on day, the next
>>>> day the line #!/bin/csh -f is not recognized.
>>>>
>>>> This is the whole rm_csh script:
>>>>
>>>>         #!/bin/csh -f
>>>> /*** fails on this line as ./rm_csh
>>>>
>>>>         set todayDate=`date "+%m%d%Y"`
>>>>
>>>>         set thePath=${1}
>>>>
>>>>         foreach FILE (`ls ${thePath}/*_*.jpg`)­
>>>> /*** error on this line as csh -f rm_csh
>>>>
>>>>             set fileDate = `echo ${FILE} | cut
>>>>         
>> -f2
>>     
>>>> -d"_" | cut -f1 -d"."`
>>>>
>>>>             if ("${fileDate}" != "${todayDate}")
>>>> then
>>>>
>>>>                rm -rf ${FILE}
>>>>
>>>>             endif
>>>>
>>>>         end
>>>>
>>>>  Any ideas?  I'm thinking it's the environment
>>>>         
>> for
>>     
>>>> some reason, but I don't
>>>> know how to fix it.
>>>>
>>>>  The script worked yesterday.  Today my server
>>>> doesn't recognize csh.
>>>>
>>>>  Michele
>>>>
>>>>  
>>>>
>>>>         
>>>
>>>  
>>>
>>>       
> ____________________­____________________­____________________­________________
>   
>>> ________
>>> Be a better friend, newshound, and 
>>> know-it-all with Yahoo! Mobile.  Try it now.
>>>
>>>       
> http://mobile.yah...­
>   
>>>
>>> --
>>> Please Note: If you hit "REPLY", your message will
>>> be sent to everyone on
>>> this mailing list ([address removed])
>>> http://linux.meet...­
>>> This message was sent by chris
>>> ([address removed]) from The New York
>>> GNU/Linux Meetup Group.
>>> To learn more about chris, visit his/her member
>>> profile:
>>> http://linux.meet...­
>>> To unsubscribe or to update your mailing list
>>> settings, click here:
>>> http://www.meetup...­
>>>
>>> Meetup Support: [address removed]
>>> 632 Broadway New York NY 10012 USA
>>>
>>>
>>>
>>>
>>> --
>>> Please Note: If you hit "REPLY", your message will
>>> be sent to everyone on this mailing list
>>> ([address removed])
>>> http://linux.meet...­
>>> This message was sent by Michele
>>> ([address removed]) from The New York
>>> GNU/Linux Meetup Group.
>>> To learn more about Michele, visit his/her member
>>> profile:
>>> http://linux.meet...­
>>> To unsubscribe or to update your mailing list
>>> settings, click here:
>>> http://www.meetup...­
>>>
>>> Meetup Support: [address removed]
>>> 632 Broadway New York NY 10012 USA
>>>
>>>
>>>       
>>
>>  
>>
>>     
> ____________________­____________________­____________________­________________
>   
>> ________
>> Be a better friend, newshound, and 
>> know-it-all with Yahoo! Mobile.  Try it now.
>>
>>     
> http://mobile.yah...­
>   
>>
>>
>>     
> === message truncated ===
>
>
>
>       ____________________­____________________­____________________­____________________­____
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yah...­
>
>
>
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> http://linux.meet...­
> This message was sent by chris ([address removed]) from The New York GNU/Linux Meetup Group.
> To learn more about chris, visit his/her member profile: http://linux.meet...­
> To unsubscribe or to update your mailing list settings, click here: http://www.meetup...­
>
> Meetup Support: [address removed]
> 632 Broadway New York NY 10012 USA
>
>
>
>   

Our Sponsors

  • Yodle

    Yodle generously provides space for the New York Linux meetup.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy