scripts

azeem ahmad azeem81 at msn.com
Thu Mar 2 22:26:40 UTC 2006




>From: John Summerfied <debian at herakles.homelinux.org>
>Reply-To: For users of Fedora Core releases <fedora-list at redhat.com>
>To: For users of Fedora Core releases <fedora-list at redhat.com>
>Subject: Re: scripts
>Date: Fri, 03 Mar 2006 05:22:53 +0800
>
>Les Mikesell wrote:
>>On Thu, 2006-03-02 at 14:18, azeem ahmad wrote:
>>
>>>hi list
>>>i got some scripts. their behavior is much wierd, they dont execute, when 
>>>i run them they say
>>>bad interpreter
>>>and if i open them and copy them into a new file which i create using vi 
>>>then the same script executes.
>>>it seems to be a problem of encoding like ASCII etc
>>>can i change them using any tools
>>>any suggestions
>>
>>
>>They were probably created under windows and transferred over
>>with carriage-return, line-feed endings intact.  If you
>>load them into vim, type :set fileformat=unix and save
>>again it should fix them.  Or use the dos2unix program.
>>
>There's a magic perl incantation you can recite. Or you can
>  cat olddir/script | tr -d '\r' >newdir/script
>for all and at the end
>  chmod +x newdir/*
>
>A quicker way with vim:
>for $f in olddir/* ; do vim -c ':set fileformat=unix' -c :wq $f ; donw
>
>Any more ways to change this light bulb?
>
>
>
>--
>
>Cheers
>John
>
>-- spambait
>1aaaaaaa at computerdatasafe.com.au  Z1aaaaaaa at computerdatasafe.com.au
>Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/
>
>do not reply off-list
>
thanks Mr. Mikesell, it worked, othewise i was in a lot trouble
Regards
Azeem





More information about the fedora-list mailing list