Re: Bash shell script issue

2016-09-09 Thread Gene Pavlovsky
On 7 September 2016 at 21:27, Eric Blake wrote: >>> project_root=$PWD >> >> Still bad. > > No, that one's good. Quotes are only REQUIRED when you want to ensure > that there is no word splitting or globbing going on, and assignment > context has neither of those. However, although the quotes are

Re: Bash shell script issue

2016-09-07 Thread Brian Inglis
On 2016-09-07 10:08, Kipton Moravec wrote: From: Eric Blake On 09/06/2016 05:36 PM, Kipton Moravec wrote: I this is the script: #!/bin/bash echo $PWD Insufficient quoting. This does not do the right thing if $PWD contains spaces. But not necessarily related to your problem at hand. project_ro

Re: Bash shell script issue

2016-09-07 Thread Eric Blake
On 09/07/2016 12:27 PM, Andrey Repin wrote: >> 243d707b6f72656a7463725f6f6f7d74 >> 120 / t o o l s \r \n e c h o $ x \r ^^^^^ > >> Shows there is not "careless edit

Re: Bash shell script issue

2016-09-07 Thread Eliot Moss
On 9/7/2016 2:12 PM, wilson wrote: > >> On 2016-09-06 18:36, Kipton Moravec wrote: I am relatively new to shell scripts, but this works on >> linux and I do not know why it does not work for me in cygwin. ... What am I doing wrong or is >> this an error? Where do the carriage returns (^M) come f

Re: Bash shell script issue

2016-09-07 Thread Eliot Moss
On 9/7/2016 1:27 PM, Andrey Repin wrote: So "Insufficient quoting" means nothing to me. How should it be? Put quotes around any variable expansion you are not in control of. I was taking the example from a shell script I found. So I added quoting on the echo: #!/bin/bash echo "$PWD"

Re: Bash shell script issue

2016-09-07 Thread wilson
On 2016-09-06 18:36, Kipton Moravec wrote: I am relatively new to shell scripts, but this works on linux and I do not know why it does not work for me in cygwin. ... What am I doing wrong or is this an error? Where do the carriage returns (^M) come from, and how do I get rid of them? The (^M

Re: Bash shell script issue

2016-09-07 Thread Erik Soderquist
On Wed, Sep 7, 2016 at 11:48 AM, Marco Atzeri wrote: >> I have been using notepad++ for my windows editor. > > \r = Carriage Return > \n = New Line / Line Feed > > so Notepad++ produced a file with CRLF as line termination and you need > to convert it with d2u. Notepad++ can also do unix line term

Re: Bash shell script issue

2016-09-07 Thread Andrey Repin
Greetings, Kipton Moravec! > dalkmora@DALM0048 ~/walnut/dp2b_walnut_customer_flextronics/walnut > $ od -cx testconvert1.sh > 000 # ! / b i n / b a s h \r \n e c h > 2123622f6e69622f73610d68650a6863 > 020 o $ P W D

Re: Bash shell script issue

2016-09-07 Thread Kipton Moravec
the middle from od command. Kip - Original Message - From: Eric Blake To: cygwin@cygwin.com; kipton_mora...@yahoo.com Sent: Tuesday, September 6, 2016 8:21 PM Subject: Re: Bash shell script issue On 09/06/2016 05:36 PM, Kipton Moravec wrote: > I this is the script: > #

Re: Bash shell script issue

2016-09-07 Thread Andrey Repin
Greetings, Kipton Moravec! > Something else I did not know. > dalkmora@DALM0048 ~/walnut/dp2b_walnut_customer_flextronics/walnut > $ od -cx testconvert1.sh > 000 # ! / b i n / b a s h \r \n e c h > 2123622f6e69622f73610d68650a6863

Re: Bash shell script issue

2016-09-07 Thread Marco Atzeri
please reply on the bottom On 07/09/2016 17:32, Kipton Moravec wrote: Something else I did not know. dalkmora@DALM0048 ~/walnut/dp2b_walnut_customer_flextronics/walnut $ od -cx testconvert1.sh 000 # ! / b i n / b a s h \r \n e c h 2123622f6e69622f

RE: Bash shell script issue

2016-09-06 Thread Michel LaBarre
September-06-16 9:21 PM > To: cygwin@cygwin.com; kipton_mora...@yahoo.com > Subject: Re: Bash shell script issue > > On 09/06/2016 05:36 PM, Kipton Moravec wrote: > > > I this is the script: > > #!/bin/bash > > echo $PWD > > Insufficient quoting. This do

Re: Bash shell script issue

2016-09-06 Thread Eric Blake
On 09/06/2016 05:36 PM, Kipton Moravec wrote: > I this is the script: > #!/bin/bash > echo $PWD Insufficient quoting. This does not do the right thing if $PWD contains spaces. But not necessarily related to your problem at hand. > project_root=$PWD > echo $project_root Again, insufficient