가능한 한 자기 문서적인 bash 스크립트를 작성하고 싶습니다.
많은 플래그가있는 소프트웨어를 실행할 때 명령을 여러 줄로 나누고 각 줄의 끝에 주석을 추가하여 플래그가 무엇을하는지 알려줍니다 (man 페이지의 정보). :
bwa aln \
-n $n \ # -n max #diff (integer) or missing prob under 0.02 err rate (float) [0.04]
-o $o \ # -o maximum number or fraction of gap opens [1]
-e $e \ # -e maximum number of gap extensions, -1 for disabling long gaps [-1]
-i $i \ # -i do not put an indel within integer bp towards the ends [5]
-d $d \ # -d maximum occurrences for extending a long deletion [10]
-l $l \ # -l seed length [32]
-k $k \ # -k maximum differences in the seed [2]
-m $m \ # -m maximum entries in the queue [2000000]
-t $t \ # -t number of threads [1]
-M $M \ # -M mismatch penalty [3]
-O $O \ # -O gap open penalty [11]
-E $E \ # -E gap extension penalty [4]
-R $R \ # -R stop searching when there are >integer equally best hits [30]
-q $q \ # -q quality threshold for read trimming down to 35bp [0]
-f $f \ # -f file to write output to instead of stdout
-B $B \ # -B length of barcode
-L $L \ # -L log-scaled gap penalty for long deletions
-N $N \ # -N non-iterative mode: search for all n-difference hits (slooow)
-I $I \ # -I the input is in the Illumina 1.3+ FASTQ-like format
-b $b \ # -b the input read file is in the BAM format
-0 $0 \ # -0 use single-end reads only (effective with -b)
-1 $1 \ # -1 use the 1st read in a pair (effective with -b)
-2 $2 \ # -2 use the 2nd read in a pair (effective with -b)
-Y $Y \ # -Y filter Casava-filtered sequences
-prefix $prefix \ # -prefix Prefix
-inputfile $inputfile \ # -inputfile Input file (FastQ format)
문제는 \ 문자 다음에 아무것도 가질 수 없다는 것입니다 (bash에게 명령이 다음 줄에서 계속된다는 것을 알려주십시오). 의견.
아무도 이것을 할 수있는 방법이나 비슷한 것을 알고 있습니까?
1
읽기가 매우 어렵습니다! 명령 전에 여러 줄 주석을 사용하면 무엇이 잘못 되었습니까?
—
gawbul
여기에는 명령이 어떻게 구성되어 있는지 보여주고 싶은 매우 구체적인 유스 케이스가 있습니다. (이 비디오를 만들어야 할 수도 있습니다 :)) : 마법사에서 항목을 선택할 때 "$ [var]"부분 교체됩니다. 나는 명령에 대한 화면 영역이 많지 않으므로 위의 목록을 두어 두 배로 높이면 너무 커질 것입니다. 또한 명령 줄 옵션이 많은 경우 주석이 설정된 위치에 절대적으로 인접 해 있도록하는 것이 매우 유용합니다.
—
Samuel Lampa