This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ ! -d "$3" ]; then | |
mkdir $3 | |
fi | |
for file in $2/* | |
do | |
outputFile=${file/$2/$3} | |
#echo "perl $1/fastq2fasta_out.pl $file ${outputFile/fastq/fasta}" | |
perl $1/fastq2fasta_out.pl $file ${outputFile}.fasta | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy from http://www.ibm.com/developerworks/aix/library/au-unixtext/ | |
Example of shell script – change file extension: | |
$ cat setup_files.ksh | |
mkdir /tmp/mv_demo | |
[ ! -d /tmp/mv_demo ] && exit | |
cd /tmp/mv_demo | |
mkdir tmp JPG 'pictures 1' | |
touch a.JPG b.jpg c.Jpg d.jPg M.jpG P.jpg JPG_file.JPG JPG.file2.jPg file1.JPG.Jpg 'tmp/ | |
pic 2.Jpg' 10.JPG.bak 'pictures 1/photo.JPG' JPG/readme.txt JPG/sos.JPG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy from http://www.ibm.com/developerworks/aix/library/au-unixtext/ | |
Example of shell script – string extraction: | |
$ cat string_example1.sh | |
#!/bin/sh | |
FILEPATH=/home/w/wyoes/samples/ksh_samples-v1.0.ksh | |
echo '${FILEPATH} =' ${FILEPATH} " # the full filepath" | |
echo '${#FILEPATH} =' ${#FILEPATH} " # length of the string" | |
echo '${FILEPATH%.*} =' ${FILEPATH%.*} " # truncate right of the last dot" | |
echo '${FILEPATH%%.*} =' ${FILEPATH%%.*} " # truncate right of the first dot" | |
echo '${FILEPATH%%/w*} =' ${FILEPATH%%/w*} " # truncate right of the first /w" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy from http://sed.sourceforge.net/sed1line.txt | |
------------------------------------------------------------------------- | |
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 | |
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5 | |
Latest version of this file (in English) is usually at: | |
http://sed.sourceforge.net/sed1line.txt | |
http://www.pement.org/sed/sed1line.txt | |
This file will also available in other languages: |