PDA

View Full Version : [ubuntu] External Drive and Shell Scripts



ashkot
July 18th, 2012, 12:11 AM
Hi all,
I have installed Ubuntu on my PC as dual boot. I have an enternal drive formatted in NTFS that i want to share between the Ubuntu and Win.

The problem is i am executing shell script on Ubuntu something like this

@ubuntu > bash myscript.sh > myfile.vcf

The issues are
Instead of my file having extension of .vcf it has an extension of vcf_

Second, when i try to open this file in Windows (its a text file), i can see the file in Windows Explorer but i get message that states "File Not found"

I am assigning permissions to myscript.sh as follows:
chmod +x myscript.sh

Can anyone help with this?

Thanks in advance.
Ashwin

lptr
July 18th, 2012, 06:11 AM
What does your script. Best you would show it to us.

ashkot
July 18th, 2012, 07:54 AM
this is a simple script

#!/bin/bash
echo "Processing"
xargs -a Omega-rs-Chr7.txt -I {} tabix -f ALL.chr7.phase1_release_v3.20101123.snps_indels_sv s.genotypes.vcf.gz {} >> Data.vcf

The file that is created at the end if Data.vcf_

Where does the _ come from?

I am trying to execute this on a external USB drive using the following
$ bash myscript.sh

lptr
July 18th, 2012, 10:14 AM
#!/bin/bash
echo "Processing"
xargs -a Omega-rs-Chr7.txt -I {} tabix -f ALL.chr7.phase1_release_v3.20101123.snps_indels_sv s.genotypes.vcf.gz {} >> Data.vcf


What happens if you don't replace - in other words - further simplifying that line?

Other approach: If this underline is consistent you could rename the target file inside your script after finished. Right?