2016-12-15 12 views
0

Ich erhalte command not found:Befehl nicht in BASH gefunden

> 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 

mit dem folgenden Skript

#!/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 

Alle Programme installiert sind. Was habe ich verpasst?

Vielen Dank im Voraus.

Mic

+0

Verwenden Sie die vollständigen Pfade. Verwenden Sie zum Beispiel statt 'find''/usr/bin/find'. –

Antwort

4

Sie setzen den PATH environment variable, das ist das, was bash Programme finden verwendet. Da PATH die Verzeichnisse, die parallel, find und sed enthalten, nicht mehr enthält, können sie nicht von bash gefunden werden.

Sie sollten den verwendeten Variablennamen von PATH in etwas anderes wie path ändern. Sie sollten auch die Verwendung von Variablen mit Anführungszeichen umgeben:

find "$path/*.gz" -type f | parallel -j "$CPUS" "fastqc {}"