Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #212650
| From | "Stephen P. Molnar" <s.molnar@sbcglobal.net> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Strange Bash Script Problem |
| Date | 2019-08-11 20:20 +0200 |
| Message-ID | <yu0BH-1NS-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
On 08/11/2019 11:56 AM, Lee wrote:
> On 8/11/19, David <bouncingcats@gmail.com> wrote:
>> On Mon, 12 Aug 2019 at 01:07, Stephen P. Molnar <s.molnar@sbcglobal.net>
>> wrote:
>>> Thanks for the suggestion.
>>> However,
>>> comp@AbNormal:~/Apps/Models/1-PhosphorusLigands/Acetylcholinesterases/3K9B/Results$
>>>
>>> ./Run.ligand.list.sh
>>> ./Run.ligand.list.sh: line 4: cd: $'Acetylcholine\r_apo-3k9b': No such
>>> file or directory
>> The form of that error message indicates that
>> the directory name attempted as a result of
>> this substitution
>> cd "${d}_apo-3k9b"
>>
>> contains a carriage return (\r) character.
>>
>> Here's a demonstration:
>>
>> [david@kablamm junk]$ cd foo$'\r'foo
>> bash: cd: $'foo\rfoo': No such file or directory
>>
>> The $'\r' in my input command is a carriage return
>> character.
>> Note the identical form of quoting in my error message
>> and your error message.
>> The $'foo\rfoo' in the error message is a carriage
>> return character between two strings 'foo'.
>>
>> If the mysterious carriage return character is not
>> in your ligand.list file, then it must be in
>> your Run.ligand.list.sh file just before the underscore
>> in the line
>> cd "${d}_apo-3k9b"
>>
>> Have a look at your script file using
>> 'cat -v Run.ligand.list.sh'
>> The effect of cat -v is to show control characters.
>>
>> If possible, use an editor that can show control characters.
>> If not available, you can edit that line in your script file in a way
>> that would remove an invisible character in the suspect position.
> Or you could try doing
> dos2unix ligand.list
> dos2unix Run.ligand.list.sh
> and see if that gets rid of the embedded \r
>
> Lee
>
>
Thanks to all that shared their expertise.
#!/bin/bash
while IFS= read -r d
do
cd "${d}_apo-3k9b"
echo "${d}_apo-3k9b"
echo "${d}_apo-3k9b.dpf"
/home/comp/Apps/Autodock/autodock4 -p "${d}_apo-3k9b.dpf" -l
"${d}_apo-3k9b.dlg"
cd ..
done <ligand.list
and dos2unix solved the problem!!!!!!
--
Stephen P. Molnar, Ph.D. Life is a fuzzy set
http://www.Molecular-Modeling.net Multivariate and stochastic
614.312.7528 (c)
Skype: smolnar1
Back to linux.debian.user | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Strange Bash Script Problem "Stephen P. Molnar" <s.molnar@sbcglobal.net> - 2019-08-11 20:20 +0200
Re: Strange Bash Script Problem Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-12 15:40 +0200
Re: Strange Bash Script Problem "Stephen P. Molnar" <s.molnar@sbcglobal.net> - 2019-08-12 16:30 +0200
Re: Strange Bash Script Problem Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-12 19:30 +0200
Re: Strange Bash Script Problem Lee <ler762@gmail.com> - 2019-08-12 19:40 +0200
Re: Strange Bash Script Problem Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-12 19:50 +0200
Re: Strange Bash Script Problem Lee <ler762@gmail.com> - 2019-08-12 20:00 +0200
Re: Strange Bash Script Problem Greg Wooledge <wooledg@eeg.ccf.org> - 2019-08-12 20:20 +0200
Re: Strange Bash Script Problem Lee <ler762@gmail.com> - 2019-08-12 21:10 +0200
Re: Strange Bash Script Problem David <bouncingcats@gmail.com> - 2019-08-13 02:00 +0200
Re: Strange Bash Script Problem Lee <ler762@gmail.com> - 2019-08-12 19:30 +0200
csiph-web