我得到command not found
:
> sh readsdb.sh `pwd`/test 2
/home/lorencm/test 2
readsdb.sh: line 8: parallel: command not found
readsdb.sh: line 8: find: command not found
hello
readsdb.sh: line 10: parallel: command not found
readsdb.sh: line 10: find: command not found
readsdb.sh: line 10: sed: command not found
readsdb.sh: line 11: parallel: command not found
readsdb.sh: line 11: find: command not found
readsdb.sh: line 12: find: command not found
readsdb.sh: line 12: parallel: command not found
> parallel -h
Usage:
parallel [options] [command [arguments]] < list_of_arguments
使用以下脚本
#!/bin/bash
module load fastqc/0.11.2-java-1.7.0_60
PATH="$1"
CPUS="$2"
echo $PATH $CPUS
find $PATH/*.gz -type f | parallel -j $CPUS "fastqc {}"
echo "hello"
find $PATH/*_fastqc.zip -type f | sed 's/\.zip$//' | parallel -j $CPUS 'unzip -c {}.zip {}/fastqc_data.txt | crimson fastqc /dev/stdin {}.json'
find $PATH/*_fastqc.zip -type f| parallel -j $CPUS 'dir={}; dir=${dir%.zip}; dir=${dir##*/}; unzip -c {} "$dir/fastqc_data.txt" | crimson fastqc /dev/stdin > {.}.json'
find $PATH/ -type f | parallel -j $CPUS md5sum '>' {}.md5
已安装所有程序。我错过了什么?
提前谢谢。
MIC
答案 0 :(得分:4)
您设置PATH
environment variable,这是bash
用于查找程序的内容。由于PATH
不再包含包含parallel
,find
和sed
的目录,因此bash
无法找到它们。
您应该将您使用的变量名称从PATH
更改为path
之类的其他名称。您还应该使用带引号的变量的使用,如下所示:
find "$path/*.gz" -type f | parallel -j "$CPUS" "fastqc {}"