Unable to call a script from another script in cshell


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unable to call a script from another script in cshell
# 1  
Old 09-13-2012
Unable to call a script from another script in cshell

Hi,

I am unable to call one script from another script in c shell on windows SUA environment.

Please find below code ,

File1 āTmp.csh:
#!/bin/csh
setenv PATH "${PATH}:.:$TOP/bin:$TOP/RMBIN/bin:$GP_SUA/:$INTERIX_ROOT"
echo "hi1"
. /tmp1.csh

File2ātmp1.csh
#!/bin/csh
echo "hi2"

While executing the script File1 it showing “Permission denied” for last line which is . /tmp1.csh.


Please help me to fix this issue.


Regards,
gthangavSmilie
# 2  
Old 09-13-2012
I'm not familiar with a windows SUA environment, but on a UNIX or Linux system, this message would mean that you haven't set the execute bits on tmp1.csh.
Try: chmod +x tmp1.csh
and then run Tmp.csh again.
# 3  
Old 09-13-2012
SmilieStill same issue. Smilieermission denied.

---------- Post updated at 04:26 AM ---------- Previous update was at 04:19 AM ----------

Below mentioned command only using to execute the script.
% . /tmp.csh
# 4  
Old 09-13-2012
Quote:
Originally Posted by gthangav
SmilieStill same issue. Smilieermission denied.

---------- Post updated at 04:26 AM ---------- Previous update was at 04:19 AM ----------

Below mentioned command only using to execute the script.
% . /tmp.csh
Don Cragun's solution should work for you..

tried this..

Code:
$ cat test.sh
echo "calling script"
./test2.sh

$ cat test2.sh
echo "it's Working"

$sh test.sh
calling script

test.sh: line 2: ./test2.sh: Permission denied

$ chmod +x test2.sh

$ sh test.sh
calling script
it's Working

# 5  
Old 09-13-2012
Try same application in csh & tell me whether working or not. Because for sh shell working fine.
File1 āTmp.csh:
#!/bin/csh
echo "hi1"
. /tmp1.csh

File2ātmp1.csh
#!/bin/csh
echo "hi2"

while execute . /tmp.csh -> Permission denied.Smilie
# 6  
Old 09-13-2012
Replace . with source in Tmp.csh.
That is, change
Code:
. /tmp1.csh

to
Code:
source /tmp1.csh

.
# 7  
Old 09-13-2012
tmp.csh

#!/bin/csh
#setenv PATH .:$TOP/bin:$TOP/RMBIN/bin:$INTERIX_ROOT
setenv PATH "${PATH}:.:$TOP/bin:$TOP/RMBIN/bin:$GP_SUA/:$INTERIX_ROOT"
source /dev/fs/C/gp/bin/tmp1.csh
echo "hi2"

tmp1.csh
#!/bin/csh
setenv PATH "${PATH}:.:$TOP/bin:$TOP/RMBIN/bin:$GP_SUA/:$INTERIX_ROOT/bin"
echo "hi1"

Output:
no such file or directories.

---------- Post updated at 05:49 AM ---------- Previous update was at 05:47 AM ----------

file path is proper. while execute from command file path showing proper.
thru script failed.

---------- Post updated at 06:08 AM ---------- Previous update was at 05:49 AM ----------

output:

% csh -x tmp.csh
setenv PATH /bin:/opt/gcc.3.3/bin:/usr/contrib/bin:/usr/X11R6/bin:/usr/local/bin
:/usr/contrib/win32/bin:.:/gp/bin:/gp/RMBIN/bin:/dev/fs/C/:/dev/fs/C/Windows/SUA
//bin
echo hi2
hi2
source /dev/fs/C/gp/bin/tmp1.csh
: No such file or directory.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assigning any number to the variable in cshell script

Hello Guys, I would like to ask you for a favor. Could you please help me how can I assign any number as the parameter to a, from stdin (-c), in the following command line by using the 'switch' in a script? awk '$8>a {print "File name:" $5,$8}' I would also appreciate if you can share any... (1 Reply)
Discussion started by: Padavan
1 Replies

2. Shell Programming and Scripting

Call a Perl script within a bash script and store the ouput in a .txt file

I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients). I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Discussion started by: mecaka
6 Replies

3. Shell Programming and Scripting

Script to call a menu script and redirect each option to a text file

Hello, I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file. For example;- In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output... (4 Replies)
Discussion started by: spradha
4 Replies

4. Shell Programming and Scripting

[Solved] Unable to call a python script from bash

Hi, I am trying to run a python script embedded in bash script. But is throwing me an error. Please help. Script: #!/bin/bash nohup /usr/bin/python /opt/web/http.py & Error: /usr/bin/python: can't open file '/opt/web/http.py': No such file or directory Please help me on this. (6 Replies)
Discussion started by: maddy26615
6 Replies

5. UNIX for Dummies Questions & Answers

this cshell script does not work ??

Hi I am trying to put the following commands that i have to type manually at the cshell prompt into a cshell script startup.csh which is copied below echo $DISPLAY xhost + rsh ba08lo01 module load incisiv/102/10.20.035 setenv DISPLAY $DISPLAY When i run the script with source command... (2 Replies)
Discussion started by: kaaliakahn
2 Replies

6. Shell Programming and Scripting

cshell script problem

Hi ,I have this simple code,why is not working thanks #!/bin/csh set res=find ./ -name "*.bash" | wc -l $res > result.txt (16 Replies)
Discussion started by: lio123
16 Replies

7. Shell Programming and Scripting

Script cShell - help!!

Hello everyone! i'm new in this forum and I'm here because I have a huge problem with a csh script. Here the problem: I have to write a script that check the system status, more precisely I have to check if there are processes with TIME > 3 hours and if such processes exists I must send a mail... (3 Replies)
Discussion started by: TheBeefEater
3 Replies

8. Shell Programming and Scripting

Unable to call executable from script

Now I am using the HP-UX11.11 version. The scripts are runninh in KSH shell. While I wan to call one executable of any Pro*C file, I have got the following error, however the executable is running fine directly. testpri Started at 10.05.200923:40 /usr/lib/dld.sl: Bad magic number for... (0 Replies)
Discussion started by: priyankak
0 Replies

9. Shell Programming and Scripting

How to make a cshell (csh) script interactive

Experts, I tried to make my cshell script interactive by asking the user for password and trying to read the input using the "read" command. I have been unsuccessful so far. Do you have any idea ? Thanks Jim (2 Replies)
Discussion started by: jimmynath
2 Replies

10. Shell Programming and Scripting

help with cshell script to read 1 or more lex files

taskes one or more .l files and compiles them #!/usr/bin/csh #while loop to carry on asking user to enter the files while $number!=0 echo "enter file name" #check to see if file ends with .l #if file ends with .l compile lexx.yy.c file for each file this is how i think it needs... (1 Reply)
Discussion started by: homerj546
1 Replies
Login or Register to Ask a Question