LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2006, 08:23 AM   #1
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Rep: Reputation: 15
error: Command Not Found


hello,

i am trying to execute the job(C shell script) on host machine using qsub. when the job completed i am getting Command Not Found error. really i dont understand why its happening like this error because in stand alone mode(workstation) the script is running fine but it wasnt when the script submitted to the host machine.

the script is:

parent.csh :-

#!/bin/csh -f
set cmd="/remote/userlinux/user1/scriptdir";
cd $cmd;
child.csh ------> using cd command it is entering in to directory and it was trying to execute child.csh that time i am getting error like child.csh: Command Not Found
echo STDOUT "excuted","\n";

child.csh :-

#!/bin/csh -f
cd /remote/userlinux/user1
ls
echo "Message Received";

Tested Result:
1. the script invoking /bin/csh exactly i confirmed.
2. i tried to set child.csh script path into PATH env var. same error Command Not Found.

kindly help me to resolve this Command Not Found error.

Thanks & Regards
dayalan

Last edited by dayalan_cse; 11-08-2006 at 01:06 AM.
 
Old 11-06-2006, 02:49 PM   #2
_john_i_
Member
 
Registered: Aug 2003
Location: Austin, TX
Distribution: Linux from Scratch
Posts: 52

Rep: Reputation: 15
Make sure child.csh has execute permissions. If not, do "chmod +x child.csh"
 
Old 11-06-2006, 10:21 PM   #3
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
hi john thx for reply

Quote:
Originally Posted by _john_i_
Make sure child.csh has execute permissions. If not, do "chmod +x child.csh"
thx for reply.
child.csh has the execute permission. for example if i have not set it i will get error like permission denied error.


Thanks & Regards
dayalan
 
Old 11-06-2006, 10:38 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,848

Rep: Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584
I've no idea what 'qsub' is, but if it's anything like cron, it'll have a very stripped down $PATH, which likely won't include current dir, so you'd have to invoke it like
./child.sh
or give the full path starting from '/'.
 
Old 11-06-2006, 11:43 PM   #5
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
hi chrism

Quote:
Originally Posted by chrism01
I've no idea what 'qsub' is, but if it's anything like cron, it'll have a very stripped down $PATH, which likely won't include current dir, so you'd have to invoke it like
./child.sh
or give the full path starting from '/'.
thx for reply.

i tried ./child.sh then also i am getting Command Not Found. if i give full path then it will work offcourse it should work. but in my code i used cd shell command to enter in to the directory so the file should be available in current directory my doubt is why am getting Command Not Found if i used child.csh or ./child.csh directly.

for example i am in my home directory i have C shell script with excutable permission in my home directory if i try to execute directly like Cshell.csh (or child.csh ) then it is working then why it is not working on host.

Thanks & Regards
dayalan
 
Old 11-07-2006, 10:53 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 17,848

Rep: Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584Reputation: 2584
Looking at your OP, I can't see where you're getting test1.csh from ?
 
Old 11-08-2006, 01:04 AM   #7
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
hi chrism

Quote:
Originally Posted by chrism01
Looking at your OP, I can't see where you're getting test1.csh from ?
thx for reply.

in OP test1.csh should come child.csh while i typed made mistake. sorry for the mistake.

Thanks & Regards
dayalan
 
Old 11-08-2006, 11:28 AM   #8
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233
first, try cat -vets test.csh
see if you got any ^M characters in there.
 
Old 11-09-2006, 01:54 AM   #9
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
hi billy

Quote:
Originally Posted by bigearsbilly
first, try cat -vets test.csh
see if you got any ^M characters in there.
hai thx for reply.

please note that file the name is not test.csh it should be Child.csh ( i given the code )
i used cat -vets Child.csh there wont be any ^M. pls see the output

Child.csh:

#!/bin/csh -f$
$
cd /remote/misc0/ddayalan$
ls$
echo "Message Received";$
$

still i am not really understand what was the problem why i am getting Command Not Found?

Thanks & Regards
dayalan
 
Old 11-09-2006, 03:21 AM   #10
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233
try
csh Child.sh
 
Old 11-09-2006, 09:22 PM   #11
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
hi billy

Quote:
Originally Posted by bigearsbilly
try
csh Child.sh

hi thx for reply.

i have doubt like when you run child.csh without using the csh child.csh it will show the output then why it is not running on host machine why i need to give csh infront of the child.csh. please help me to understand the problem.

please see the posted example code.

Thanks & Regards
dayalan
 
Old 11-10-2006, 02:47 AM   #12
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: NetBSD, Void, Debian, Mint, Ubuntu, Puppy, Raspbian
Posts: 3,487

Rep: Reputation: 233Reputation: 233Reputation: 233
try ./Child.sh


what is your $PATH variable? does it include '.'
?

host machine?

Last edited by bigearsbilly; 11-10-2006 at 02:48 AM.
 
Old 11-15-2006, 11:59 PM   #13
dayalan_cse
Member
 
Registered: Oct 2006
Posts: 132

Original Poster
Rep: Reputation: 15
hai

Quote:
Originally Posted by bigearsbilly
try ./Child.sh


what is your $PATH variable? does it include '.'
?

host machine?

thank for the reply.

the only thing i am always having doubt in the PATH variable which may not be same from client and the host machine. i am sure you are correct the PATH variable is not getting set properly thats why i had faced the problem. what i done is given the full path of the file then its getting execute and no error. still i am confusing why should i have to include full path to execute the script because i am using cd to script resided directory and i am trying to execute child.csh it gave me error. why.....? confused



Thanks & Regards
dayalan
 
  


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 Deelk Slackware 12 04-23-2006 02:12 PM
command not found error cdsnithi Linux - Software 2 07-06-2005 12:26 PM
command not found error lordshipmayhem Linux - Newbie 4 06-28-2005 09:15 PM
c++ command not found error... ? Cheka Linux - Newbie 2 01-29-2005 03:43 PM
bash: command not found error ksgill Linux - Newbie 10 07-01-2003 03:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:03 AM.

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