LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2015, 01:59 PM   #16
I_Keep_Trying
LQ Newbie
 
Registered: Nov 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled

Quote:
Originally Posted by grail View Post
ditto to Notepad++ if in Windows
Thank you both for the suggestions on the text editor on windows. This is probably a really dumb question, but could I open the script files up on my work computer, edit it, and save it again(on a windows) and have that "possibly" eliminate this issue?

Thanks again for everyone's help.
 
Old 11-24-2015, 02:09 PM   #17
LanceTaylor
Member
 
Registered: Nov 2015
Location: Houston, Texas, US
Distribution: RHEL/CentOS, Debian/Linux Mint, SLES
Posts: 40

Rep: Reputation: 19
Yes, I also recommend Notepad++. It is free and is currently maintained.
 
1 members found this post helpful.
Old 11-24-2015, 02:30 PM   #18
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by I_Keep_Trying View Post
Thank you both for the suggestions on the text editor on windows. This is probably a really dumb question, but could I open the script files up on my work computer, edit it, and save it again(on a windows) and have that "possibly" eliminate this issue?

Thanks again for everyone's help.
Any editing on a Windows machine will inject the wrong line endings into the file (unless you use one of those editors that can be configured to use Unix line endings, like Notepad++), and require you to run dos2unix on the file before it can be used on a Linux system. I don't believe any of those editors that can be configured to use Unix line endings will fix a previously-created file that uses the wrong ones though, it's best to just run dos2unix on it and fix it outright, and from then on make sure to only use editors that use Unix line endings.

Last edited by suicidaleggroll; 11-24-2015 at 02:33 PM.
 
1 members found this post helpful.
Old 11-24-2015, 03:46 PM   #19
LanceTaylor
Member
 
Registered: Nov 2015
Location: Houston, Texas, US
Distribution: RHEL/CentOS, Debian/Linux Mint, SLES
Posts: 40

Rep: Reputation: 19
Quote:
Originally Posted by suicidaleggroll View Post
Any editing on a Windows machine will inject the wrong line endings into the file (unless you use one of those editors that can be configured to use Unix line endings, like Notepad++), and require you to run dos2unix on the file before it can be used on a Linux system. I don't believe any of those editors that can be configured to use Unix line endings will fix a previously-created file that uses the wrong ones though, it's best to just run dos2unix on it and fix it outright, and from then on make sure to only use editors that use Unix line endings.
You can see if a file has the ^M at the end of a line using:
Code:
cat -v textfile
Notepad++ can remove them. Go to the Edit menu, select EOL Conversion, then select UNIX/OSX Format. Save the file and the hidden characters will be gone.
 
2 members found this post helpful.
Old 11-24-2015, 04:57 PM   #20
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
This ++
Quote:
it's best to just run dos2unix on it and fix it outright, and from then on make sure to only use editors that use Unix line endings.
Also, I'd highly recommend avoiding spaces in file/dir names if possible.
The default *nix convention is that params passed to a program are space separated ... from which you can see that spaces cause issues on *nix.

As for the "TV[]", that's probably some kind of ctrl char you've managed to accidentally add.
Try renaming it, but that might be tricky, or move the contents, then delete it and recreate it.
 
1 members found this post helpful.
Old 11-25-2015, 11:29 AM   #21
I_Keep_Trying
LQ Newbie
 
Registered: Nov 2015
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hello everyone, it is I reporting back.

Thanks to everyone here that helped and offered suggestions. You guys completely rock!

So I 86'd the written scripts, brought my laptop in to the office with me and wrote out a new one on linux. (I also added dos2unix to my machines)

So I set up the scheduler and went to work.

I have just checked, it appears to have exited with code 0, and it looks like it worked. Now, on to the removal of the extra files, and then set up something similar where a random playlist is copied over to my phone from my media centre for my daily commute.

Thanks again everyone for all your awesome help!
 
Old 11-25-2015, 11:37 AM   #22
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Awesome progress!
 
Old 11-25-2015, 02:52 PM   #23
LanceTaylor
Member
 
Registered: Nov 2015
Location: Houston, Texas, US
Distribution: RHEL/CentOS, Debian/Linux Mint, SLES
Posts: 40

Rep: Reputation: 19
Great! Thanks for posting the end results.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Basic Scripting query rasanpreet Linux - Server 1 04-22-2015 03:20 AM
[SOLVED] basic scripting ?'s minty33 Linux - Newbie 6 09-28-2012 07:29 PM
[SOLVED] Basic Scripting help Dru-Jitsu Linux - Newbie 7 07-14-2010 08:02 AM
Basic Scripting karlochacon Linux - Newbie 6 11-12-2009 06:22 PM
Basic shell scripting help zipper777 Linux - Newbie 6 03-13-2006 12:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration