This is a test version of Biostars. For the public version, visit https://www.biostars.org.
sam2tsv add in my path

please can anyone tell me how to add sam2tsv in my path. I try the following command: export PATH="$PATH:/home/aclab/apps/jvarkit/dist/sam2tsv.jar" I also try this:

sudo mv /path/to/sam2tsv.jar /usr/local/bin/
sudo ln -s /usr/local/bin/sam2tsv.jar /usr/local/bin/sam2tsv
sudo nano /usr/local/bin/sam2tsv
#!/bin/bash
java -jar /usr/local/bin/sam2tsv.jar "$@"
sudo chmod +x /usr/local/bin/sam2tsv
sam2tsv --help

But none of them help can please solve this issue. thanks in advance

sam2tsv

1 answer

1) This is a JAR file, not an executable. So the first solution is useless.

2) In the second solution the sudo chmod +x is useless. Just run this sudo chmod +x /usr/local/bin/sam2ts once for this bash script which should only be:

#!/bin/bash
java -jar /path/to/sam2tsv.jar $@

3) unless you're working with a very old version of jvarkit , there is no such "sam2tsv.jar". The command should be:

java -jar /path/to/jvarkit.jar sam2tsv ...
`

Hi so I download the latest version of java and jvarkit. but still i don't know how to move sam2tsv in my path. So I have not every time written whole command like other tools. Thanks in advance for solving the issue.

again, you don't need that shell script 'sam2tsv'. just run java -jar /path/to/jvarkit.jar sam2tsv ...

and acknowledge all your previous questions above.

Log in to answer this question.