[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Strange Bash Script Problem



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.


Reply to: