#!/bin/ksh
# String manipulation
FILES=../Output/*
for f in $FILES
do
echo "Processing $f file..."
# take action on each file. $f store current file name
# string length
echo "length is ${#f}"
# substring of length 15 in variable f from the position 10. # g=${f:10:15}
# f contains file name in the format ../Output/ImmediateRecall10MinSet1_kuiper_OK
g=${f#*/} # delete the ../ from the begining
g=${g#*/} # Now delete the Ouput/ from the begining
g=${g%_*} # Now delete the _OK from the back
g=${g%_*} # Now delete the _kuiper from the back
echo "g is $g"
cp $f/*.txt $g/
done
Subscribe to:
Post Comments (Atom)
-
To install pngwrite we need to install to helper library before we install pngwriter. 1. libpng 2. freetype2 We can use fink or macport to i...
-
Parsing and displaying dates and times is often complicated because of formatting and locale issues. Java 2 Platform, Standard Edition (J2S...
No comments:
Post a Comment