Re: [SLUG] cygwin script file name error

2014-02-22 Thread Jiří Baum
Hi,

> I re-created and retyped all 3 lines, actually, pasted one line at a time.
> (more than once...)

If all else fails, try putting # signs on the end of each line... then
the ^M will be comments :-)


Jiri
-- 
Jiří Baum 
Sabik Software Solutions Pty Ltd
0413 183 117
http://www.baum.com.au/sabik
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Re: [SLUG] cygwin script file name error

2014-02-21 Thread lists
On Fri, February 21, 2014 10:11 pm, Amos Shapira wrote:
> I don't see the ^M's that I was expecting. Is this file cleaned and
> working? Perhaps "cat" in Cygwin requires an additional option to show
> ^M's?

Amos, thanks

I re-created and retyped all 3 lines, actually, pasted one line at a time.
(more than once...)
I guess I can also run 'dos2unix' to strip the CRs

I'll recheck/redo the two or three scripts that I've made

thanks for all the tips and help

v

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-21 Thread Amos Shapira
I don't see the ^M's that I was expecting. Is this file cleaned and working?
Perhaps "cat" in Cygwin requires an additional option to show ^M's?



On 21 February 2014 21:44,  wrote:

> On Fri, February 21, 2014 8:05 pm, Amos Shapira wrote:
> > BTW, in addition to the rest that was said, "cat -tve" is very useful in
> > troubleshooting such issues.
>
> >> $ cat /home/voytek/sendsms
> >> #! /bin/sh
> >> cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now.txt date  >>
> >> /var/spool/sms/sms_out_now.txt
> >> mv /var/spool/sms/sms_out_now.txt /var/spool/sms/outgoing/
>
> Amos,
>
> thanks !
>
> $ cat -tve sendsms
> #! /bin/sh$
> cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now$
> date  >>  /var/spool/sms/sms_out_now$
> mv /var/spool/sms/sms_out_now /var/spool/sms/outgoing/$
> $
>
>
>
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>



-- 
 [image: View my profile on LinkedIn]

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-21 Thread lists
On Fri, February 21, 2014 8:05 pm, Amos Shapira wrote:
> BTW, in addition to the rest that was said, "cat -tve" is very useful in
> troubleshooting such issues.

>> $ cat /home/voytek/sendsms
>> #! /bin/sh
>> cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now.txt date  >>
>> /var/spool/sms/sms_out_now.txt
>> mv /var/spool/sms/sms_out_now.txt /var/spool/sms/outgoing/

Amos,

thanks !

$ cat -tve sendsms
#! /bin/sh$
cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now$
date  >>  /var/spool/sms/sms_out_now$
mv /var/spool/sms/sms_out_now /var/spool/sms/outgoing/$
$



-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-21 Thread Amos Shapira
BTW, in addition to the rest that was said, "cat -tve" is very useful in
troubleshooting such issues.
On 21 Feb 2014 15:24,  wrote:

> I've made a crude script under cygwin/XP, it was mainly working, but,
> after some edits, I'm getting a '?' appended to file name ?
> as so:
> sms_out_now.txt?
>
> when I paste individual lines at command line, it seems to work, when I
> run from the 3 line script, it seems to append the '?'
> where am I going wrong, I'm trying to copy small file, then, put current
> time/date:
>
> the problem (I think?) arose after I added 'date >>' part
>
>  ~
> $ cat /home/voytek/sendsms
> #! /bin/sh
> cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now.txt
> date  >>  /var/spool/sms/sms_out_now.txt
> mv /var/spool/sms/sms_out_now.txt /var/spool/sms/outgoing/
>
> $ ls -al /var/spool/sms/
> ...
> drwxr-xr-x+ 1 voytek None  0 Feb 21 15:08 .
> drwxr-xr-x+ 1 voytek None  0 Jan 29  2010 ..
> ...
> -rwxr-xr-x  1 voytek None 62 Feb 18 21:47 sms_out
> -rwxr-xr-x  1 voytek None 92 Feb 21 10:37 sms_out_now.txt?
>
>
> voytek
>
>
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-21 Thread kfoskey
notepad and write all use CR LF line ends. Have a look at Notepad++ and 
check for unix line endings or LF.


There is also an options somewhere to use CRLF line ends in cygwin,  never 
used it but remember it from install years ago...




-Original Message- 
From: Voytek

Sent: Friday, February 21, 2014 5:05 PM
To: kfos...@tpg.com.au ; slug@slug.org.au
Subject: Re: [SLUG] cygwin script file name error



kfos...@tpg.com.au wrote:

This will be an unreadable character in your script.

Cygwin has two modes Unix line ends and Windows line ends.The ? is
actually a \r

In 'vi'   ':set ff=unix'':wq'  to switch line endings.

if there is a \r showing go to it and press 'x' to delete it.


If I type in notepad? or in write? can I then copy and paste into vi?
Our will that cause problem?
--
Sent from Kaiten Mail. Please excuse my brevity.



-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4335 / Virus Database: 3705/7111 - Release Date: 02/20/14 




-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4335 / Virus Database: 3705/7111 - Release Date: 02/20/14

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-20 Thread Voytek


kfos...@tpg.com.au wrote:
>This will be an unreadable character in your script.
>
>Cygwin has two modes Unix line ends and Windows line ends.The ? is 
>actually a \r
>
>In 'vi'   ':set ff=unix'':wq'  to switch line endings.
>
>if there is a \r showing go to it and press 'x' to delete it.

If I type in notepad? or in write? can I then copy and paste into vi?
Our will that cause problem?
-- 
Sent from Kaiten Mail. Please excuse my brevity.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-20 Thread Voytek


kfos...@tpg.com.au wrote:
>This will be an unreadable character in your script.
>
>Cygwin has two modes Unix line ends and Windows line ends.The ? is 
>actually a \r
>
>In 'vi'   ':set ff=unix'':wq'  to switch line endings.
>
>if there is a \r showing go to it and press 'x' to delete it.
>

Thanks, I'll try that later.
(I might have used win write at some point, which probably is the root cause of 
my woes)
-- 
Sent from Kaiten Mail. Please excuse my brevity.
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] cygwin script file name error

2014-02-20 Thread kfoskey

This will be an unreadable character in your script.

Cygwin has two modes Unix line ends and Windows line ends.The ? is 
actually a \r


In 'vi'   ':set ff=unix'':wq'  to switch line endings.

if there is a \r showing go to it and press 'x' to delete it.



-Original Message- 
From: li...@sbt.net.au

Sent: Friday, February 21, 2014 3:24 PM
To: slug@slug.org.au
Subject: [SLUG] cygwin script file name error

I've made a crude script under cygwin/XP, it was mainly working, but,
after some edits, I'm getting a '?' appended to file name ?
as so:
sms_out_now.txt?

when I paste individual lines at command line, it seems to work, when I
run from the 3 line script, it seems to append the '?'
where am I going wrong, I'm trying to copy small file, then, put current
time/date:

the problem (I think?) arose after I added 'date >>' part

~
$ cat /home/voytek/sendsms
#! /bin/sh
cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now.txt
date  >>  /var/spool/sms/sms_out_now.txt
mv /var/spool/sms/sms_out_now.txt /var/spool/sms/outgoing/

$ ls -al /var/spool/sms/
...
drwxr-xr-x+ 1 voytek None  0 Feb 21 15:08 .
drwxr-xr-x+ 1 voytek None  0 Jan 29  2010 ..
...
-rwxr-xr-x  1 voytek None 62 Feb 18 21:47 sms_out
-rwxr-xr-x  1 voytek None 92 Feb 21 10:37 sms_out_now.txt?


voytek


--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html



-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4335 / Virus Database: 3705/7102 - Release Date: 02/17/14 




-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4335 / Virus Database: 3705/7102 - Release Date: 02/17/14

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


[SLUG] cygwin script file name error

2014-02-20 Thread lists
I've made a crude script under cygwin/XP, it was mainly working, but,
after some edits, I'm getting a '?' appended to file name ?
as so:
sms_out_now.txt?

when I paste individual lines at command line, it seems to work, when I
run from the 3 line script, it seems to append the '?'
where am I going wrong, I'm trying to copy small file, then, put current
time/date:

the problem (I think?) arose after I added 'date >>' part

 ~
$ cat /home/voytek/sendsms
#! /bin/sh
cp /var/spool/sms/sms_out /var/spool/sms/sms_out_now.txt
date  >>  /var/spool/sms/sms_out_now.txt
mv /var/spool/sms/sms_out_now.txt /var/spool/sms/outgoing/

$ ls -al /var/spool/sms/
...
drwxr-xr-x+ 1 voytek None  0 Feb 21 15:08 .
drwxr-xr-x+ 1 voytek None  0 Jan 29  2010 ..
...
-rwxr-xr-x  1 voytek None 62 Feb 18 21:47 sms_out
-rwxr-xr-x  1 voytek None 92 Feb 21 10:37 sms_out_now.txt?


voytek


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html