Making file executable


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Making file executable
# 1  
Old 10-20-2010
Making file executable

Hi guys, i'm trying to make a file called 'run-all-tests' executable but it is not letting me for some reason. I am presented with the following error: chmod: cannot access `./run-tests': No such file or directory

Basically i have a folder called ex3 and within that there are task folders: task1.2 task1.3 etc etc. and each of these tasks have a java program. I have made a run-tests file in each of these task folders:

Code:
#!/bin/bash
set -v
java {name of program}

I then created a run-all-tests file in the ex3 folder with following contents:
Code:
#!bin/bash
for task in task*
do
   echo "========================="
   echo "Task $task"
   echo "--------------------------------------"
   (cd $task; ./run-tests) 2>&1
done | less

I then ran chmod +x ./run-tests and it didnt work.

Any help?

Kind regards

Shyam

Last edited by Scott; 10-20-2010 at 07:51 PM.. Reason: Please use code tags
# 2  
Old 10-20-2010
Sometimes you're saying run-tests and sometimes you're saying run-all-tests. Make sure you have that straight. Smilie
# 3  
Old 10-20-2010
No you dont understand. I saved files by the name run-tests in each task folder, but then i want to run all the tests at once so i created a run-all-tests in the ex3 folder where all the task folders are. Then i tried to make it executeable but doesnt work Smilie
# 4  
Old 10-20-2010
Code:
chmod +x ./run-tests  # try to remove the slash from there and then try

like this -> chmod 777 run-tests
# 5  
Old 10-20-2010
But in your post you're running chmod on ./run-tests, not on ./run-all-tests. Make sure you have this straight. chmod +x ./run-all-tests

Quote:
chmod 777
No no no. 777 is never a good idea. If +x didn't find the file 777 won't find it either, anyway.
# 6  
Old 10-20-2010
i did that but it doesnt run all the programs. it still says u do not have permission ...etc
# 7  
Old 10-20-2010
You have to be very specific and very exact. I can't guess what you're doing or even what program is producing what error message from the vague things you're telling me. Run these things:

Code:
ls -l
chmod +x ./run-all-scripts
./run-all-scripts

...and tell me exactly what they print, in what order. Copy-paste it if you can.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Making bash script allways executable when transfer ?

Does it possible to make some bash script automatic to be a executable when transfered to another pc...? (5 Replies)
Discussion started by: tomislav91
5 Replies

2. Shell Programming and Scripting

Making any script executable

Hi all, I'm new to Unix so just wanted some help. I've been self learning and came accross a question online that I was trying. It is to make any shell script executable, the name of the file is to be made executable. I would use nano and type in something like #! /bin/bash Chmod +x... (4 Replies)
Discussion started by: HelenaR
4 Replies

3. UNIX for Advanced & Expert Users

What choice when "making" an executable on FreeBSD?

I should make an executable on our server, and are having some problem (I changed this question cause I found out that anser). I'm getting this error when trying to do make: In file included from... /usr/include/sys/file.h:161: error: expected specifier-qualifier-list before 'u_int' *** Error... (1 Reply)
Discussion started by: 244an
1 Replies

4. Shell Programming and Scripting

Making a perl script executable

Hello, I have a perl program called snp_hwe.pl I have another program called hwe_test.run which contains the following: for file in *.inp do cp $file genotype_counts_c.txt ./snp_hwe.exe > $file'.res' done I want to change my perl program to an executable program while changing... (3 Replies)
Discussion started by: Homa
3 Replies

5. Shell Programming and Scripting

problem in making Awk executable script

Guys I placed #!path/awk -f placed awk script and used $1 to call 1st inputfile inside the script. But some where I did mistake. Could you please help me run this script as executable I forgot to mention I also used BEGIN before placing awk script. But nothing worked out. Script ... (2 Replies)
Discussion started by: repinementer
2 Replies

6. UNIX for Dummies Questions & Answers

need help making a script executable

making a script in vi to create a shell script called wherearethey by entering the following script: echo -n "Who are you looking for: "read userif then list=`w | grep $user | cut -c19-30` if then echo "The user $user is logged in from $list" else echo "The user $user is not logged in... (3 Replies)
Discussion started by: curtner
3 Replies

7. UNIX for Dummies Questions & Answers

Making UNIX script executable

Hello, I am very new to UNIX and I have been learning about writing scripts and making them executable. I created a script called myscript. It has three lines: #! /bin/sh # This is my first shell script echo friendsjustfriends Now I try to run it using the sh command and it works Next I... (4 Replies)
Discussion started by: rohitx
4 Replies

8. AIX

Making Executable File

Hi All: I am a newbie. I have shell script and bunch of java jar files and I want to give one single executable file (may be .bin). Ex: I have test.sh, jar1.jar, jar2.jar. I have to make process.xxx When we run "process.xxx" it will run the "test.sh" script which inturn uses jar1.jar and... (0 Replies)
Discussion started by: laxman123
0 Replies

9. Filesystems, Disks and Memory

pls hlp: making .sh files executable

I've got a file named jdictd.sh containing the following: --- begin file contents --- #! /bin/csh echo I\'m running! java -cp jdictd.jar org.dict.server.JDictd data/dict.ini # Use the following line instead if JRE 1.1 is used # jre -cp jdictd.jar org.dict.server.JDictd data/dict.ini ---end... (2 Replies)
Discussion started by: ropers
2 Replies
Login or Register to Ask a Question