Help with shell script - not finding files

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with shell script - not finding files
# 1  
Old 11-11-2013
Help with shell script - not finding files


I have a shell script like the one below but cannot get it working:
#$ -cwd

# directories
# executable
# parameters
# reference data files
# GWAS data files in PLINK BED format

# problem SNP file
# main output file
## phase GWAS genotypes
--input-map $GENMAP_FILE \
--exclude-snp $EXCLUDE_SNP \
--thread $THREAT \
--effective-size $EFFECTIVESIZE \
--output-log $OUTPUT_LOG


I am trying to run a program called SHAPEIT. When I run the shell script, I get the following error:
Segmented HAPlotype Estimation & Imputation Tool
  * Authors : Joe BLOGGS
  * Contact :
  * Webpage : http:://
  * Version : v2.r727
ERROR: [./chr.alignments.snp.strand.exclude] is impossible to open, check file existence or reading permissions

I have the following files in my root directory for chromosome 2 with full permissions:

My shell script is clearly reading the chr2.unphased.fam/bed/bim files, but not my chr2.alignments.snp.strand.exclude. Any ideas why this is? Thanks for any help.

Last edited by Scott; 11-11-2013 at 03:58 PM.. Reason: Add code tags; obfuscate data
# 2  
Old 11-11-2013
CHR=$2 represent the 2nd argument given at the command line.
Are you invoking the command as:
command <arg1> <arg2> ?

It looks like you expect a directory to be called chr2. For your script to work it has to be invoked as:

script_name <arg1> 2

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding file extension on C Shell script

I very new to C Shell. I am trying to do is read from Command line. Find the if the file is zip, .txt, symbloic link,pipe, unknow (if file is not zip, txt, sy....) here is what I what got so far. I am very stuck atm Please help me out : If the file is symblooc link what file is link to ... (12 Replies)
Discussion started by: madbull41
12 Replies

2. Shell Programming and Scripting

Need help in finding and copying list of files using bash shell script

Dear All, I have a situation where I want to copy some files of type .txt. These files are o/p from one program. Some of the files are named as fileName .txt instead of fileName.txt after fileName by mistake I have specified "space". Now I want to move these files as follows. mv fileName*... (13 Replies)
Discussion started by: linuxUser_
13 Replies

3. Answers to Frequently Asked Questions

Finding the nth Particular Week in a Month shell script

I see lot of request posted in internet to find out the day of nth week in a Month. example: what is the date of 3rd Sunday in October What is the date of 2nd Friday in June 2012 what is the date of 4th Saturday in January 2011..etc.. The below shell script is used to find out the... (1 Reply)
Discussion started by: itkamaraj
1 Replies

4. UNIX for Dummies Questions & Answers

Shell script - Finding Autosys job status

Hi, There are 2000 jobs in the list and i need to draw their status. I put all the jobs in the list and trying to read one by one from the list and to find out the status. Help me out in correcting the script. #!/bin/csh for a in $(cat Jobs_List.txt); do source <<path>> autorep -j $a... (1 Reply)
Discussion started by: venkatesht
1 Replies

5. Shell Programming and Scripting

shell script for finding average runtime of other script

so I've made a shell script that downloads 6 files in succession from a given url, then deletes them. Now I want to time the script, and the average time it uses by running it ~100 times. My problem is tho, how do I store the time it takes for each run through of the script? I know time writes to... (3 Replies)
Discussion started by: navlelo
3 Replies

6. Red Hat

Need help with a shell script for finding a certain pattern from log file

Hell Guys, Being a newbie, I need some help in finding a certain string from a log file of thousands of lines (around 30K lines) and have the output in a separate file. Below is the file output - - - "POST... (15 Replies)
Discussion started by: rockf1bull
15 Replies

7. Shell Programming and Scripting

Finding all script files

Hello All, After a HDD crash, I would like to selectively back up all my script files. What is the most efficient way to do this? The pseudo code I was thinking of was something like this: for a in `find ./ -name "*"` do if (file $a) == Bourne|Tcsh|... then echo $a >>... (7 Replies)
Discussion started by: pru
7 Replies

8. Shell Programming and Scripting

need help in finding a string and to send an email using shell script

Hi All i am writing a shell script which will search for a string "expires". once the search string is found it has to give the email address as the output and send an email to the person This is basically to find the encrypetd keys which are loaded in the unix server Below are sample... (10 Replies)
Discussion started by: ranga27
10 Replies

9. UNIX for Dummies Questions & Answers

Unix shell script for finding top ten files of maximum size

I need to write a Unix shell script which will list top 10 files in a directory tree on basis of size. i.e. first file should be the biggest in the whole directory and all its sub directories. Please suggest any ideas (10 Replies)
Discussion started by: abhilashnair
10 Replies
Login or Register to Ask a Question