LinuxQuestions.org
Register a domain and help support LQ
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 12-10-2012, 06:12 AM   #1
Reignfire
Member
 
Registered: Jun 2012
Posts: 56

Rep: Reputation: Disabled
$'\r': command not found script error


Hi,

When i run my script it creates the following errorfile:

Code:
/var/spool/gridengine/execd/node1/job_scripts/160: line 2: $'\r': command not found
/var/spool/gridengine/execd/node1/job_scripts/160: line 9: $'\r': command not found
This is the script i'm running:

#!/bin/bash

#$-cwd

#$-S /bin/sh

#$-N SAFKTAT1
#$-t 6970-10230:1



/var/software/packages/Mathematica/7.0/Executables/math -run "teller=$SGE_TASK_ID;<< ModelFotokatalyseTAT.m"

The script used to work so i don't thing there is anything wrong with it.
 
Old 12-10-2012, 07:18 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Just a guess, but did this script by accident come in contact with an editor on a Windows machine? Line-end in Linux is '\n' while in Windows it is '\r\n'.

Depending on the distribution, the commands to convert are fromdos or dos2unix
 
1 members found this post helpful.
Old 12-10-2012, 09:06 AM   #3
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Such convention ($'\r') is used in bash. Did you make any modification in script interpreter or working environment?
Can you once check output of the cmd:
Code:
which bash
 
Old 12-10-2012, 09:15 AM   #4
Reignfire
Member
 
Registered: Jun 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
The error seems to be gone when i run the script as root...
 
Old 12-10-2012, 09:23 AM   #5
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,797
Blog Entries: 4

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by Reignfire View Post
The error seems to be gone when i run the script as root...
A script is purly shell specific, which is used to interpret it. Though script's execution may or may not be permitted to certain users, but as far as I know there's no relation between executer and script, exept it's execution permissions.

Anyway, if it ok for you, then you can mark the thread as SOLVED (Under Thread Tools option on the top).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
"Command not found" error using expr in shell script Harish sharma Linux - Newbie 17 11-08-2012 05:53 AM
[SOLVED] command not found error when running my bash script thras0 Programming 3 07-28-2012 02:43 PM
command not found error while executing a shell script SurbhiJain Linux - Newbie 15 07-26-2010 09:18 AM
Can't seem to run a simple shell script error command not found each time SimonT Linux - Newbie 5 10-29-2006 06:31 AM


All times are GMT -5. The time now is 04:50 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration