Re: Strange Bash Script Problem

2019-08-12 Thread David
On Tue, 13 Aug 2019 at 05:04, Lee wrote: > On 8/12/19, Greg Wooledge wrote: > > On Mon, Aug 12, 2019 at 01:56:46PM -0400, Lee wrote: >> What's the difference between ${d} and "${d}"? Or is that a bashism >> also? (all my scripts use /bin/sh so I'm pretty clueless wrt bash) > > > > For more deta

Re: Strange Bash Script Problem

2019-08-12 Thread Lee
On 8/12/19, Greg Wooledge wrote: > On Mon, Aug 12, 2019 at 01:56:46PM -0400, Lee wrote: >> What's the difference between ${d} and "${d}"? Or is that a bashism >> also? (all my scripts use /bin/sh so I'm pretty clueless wrt bash) > > This applies to both sh and bash. > > An unquoted substitution,

Re: Strange Bash Script Problem

2019-08-12 Thread Greg Wooledge
On Mon, Aug 12, 2019 at 01:56:46PM -0400, Lee wrote: > What's the difference between ${d} and "${d}"? Or is that a bashism > also? (all my scripts use /bin/sh so I'm pretty clueless wrt bash) This applies to both sh and bash. An unquoted substitution, like $d or ${d}, undergoes several steps. T

Re: Strange Bash Script Problem

2019-08-12 Thread Lee
On 8/12/19, Greg Wooledge wrote: > On Mon, Aug 12, 2019 at 01:37:16PM -0400, Lee wrote: >> On 8/12/19, Greg Wooledge wrote: >> > On Mon, Aug 12, 2019 at 01:19:45PM -0400, Lee wrote: >> >> On 8/12/19, Greg Wooledge wrote: >> >> > P.S. it would also have been possible to work around the carriage >

Re: Strange Bash Script Problem

2019-08-12 Thread Greg Wooledge
On Mon, Aug 12, 2019 at 01:37:16PM -0400, Lee wrote: > On 8/12/19, Greg Wooledge wrote: > > On Mon, Aug 12, 2019 at 01:19:45PM -0400, Lee wrote: > >> On 8/12/19, Greg Wooledge wrote: > >> > P.S. it would also have been possible to work around the carriage > >> > return > >> > issues with IFS, but

Re: Strange Bash Script Problem

2019-08-12 Thread Lee
On 8/12/19, Greg Wooledge wrote: > On Mon, Aug 12, 2019 at 01:19:45PM -0400, Lee wrote: >> On 8/12/19, Greg Wooledge wrote: >> > P.S. it would also have been possible to work around the carriage >> > return >> > issues with IFS, but your dos2unix approach is perfectly valid as well. >> >> Just ou

Re: Strange Bash Script Problem

2019-08-12 Thread Greg Wooledge
On Mon, Aug 12, 2019 at 01:19:45PM -0400, Lee wrote: > On 8/12/19, Greg Wooledge wrote: > > P.S. it would also have been possible to work around the carriage return > > issues with IFS, but your dos2unix approach is perfectly valid as well. > > Just out of curiosity - how? while IFS=$' \t\r\n' r

Re: Strange Bash Script Problem

2019-08-12 Thread Lee
On 8/12/19, Greg Wooledge wrote: > On Sun, Aug 11, 2019 at 02:10:06PM -0400, Stephen P. Molnar wrote: >> 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/com

Re: Strange Bash Script Problem

2019-08-12 Thread Stephen P. Molnar
On 08/12/2019 09:39 AM, Greg Wooledge wrote: On Sun, Aug 11, 2019 at 02:10:06PM -0400, Stephen P. Molnar wrote: 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/

Re: Strange Bash Script Problem

2019-08-12 Thread Greg Wooledge
On Sun, Aug 11, 2019 at 02:10:06PM -0400, Stephen P. Molnar wrote: > 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.

Re: Strange Bash Script Problem

2019-08-11 Thread Stephen P. Molnar
On 08/11/2019 11:56 AM, Lee wrote: On 8/11/19, David wrote: On Mon, 12 Aug 2019 at 01:07, Stephen P. Molnar 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: c

Re: Strange Bash Script Problem

2019-08-11 Thread Lee
On 8/11/19, David wrote: > On Mon, 12 Aug 2019 at 01:07, Stephen P. Molnar > 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_ap

Re: Strange Bash Script Problem

2019-08-11 Thread David
On Mon, 12 Aug 2019 at 01:07, Stephen P. Molnar 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

Re: Strange Bash Script Problem

2019-08-11 Thread Stephen P. Molnar
On 08/11/2019 10:39 AM, David wrote: On Sun, 11 Aug 2019 at 23:18, Stephen P. Molnar wrote: I am running an up-to-date installation of Buster on my Linux platform and have run into a strange problem with a bash script. [...] for d in $(cat ligand.list) This line is the problem, it is vul

Re: Strange Bash Script Problem

2019-08-11 Thread David
On Sun, 11 Aug 2019 at 23:18, Stephen P. Molnar wrote: > > I am running an up-to-date installation of Buster on my Linux platform > and have run into a strange problem with a bash script. [...] > for d in $(cat ligand.list) This line is the problem, it is vulnerable to various kinds of breakage

Re: Strange Bash Script Problem

2019-08-11 Thread tomas
On Sun, Aug 11, 2019 at 09:17:53AM -0400, Stephen P. Molnar wrote: > I am running an up-to-date installation of Buster on my Linux > platform and have run into a strange problem with a bash script. > > I have a number of ligand protein docking applications which involve > ligand sets docking on a