linux - Bash doesn't create files in nested scripts -
when run first script calls second script no files created.
however, when call second 1 directly same code appears on "echo", it runs expected.' therefore, don't what's wrong, code runs separately.
./first_script.sh 2 ../espn
first script:
#!/bin/bash echo "$2/$1" > format.temp format=$(<format.temp) format=$format"g.t*" echo "./second_script.sh $format" ./second_script.sh $format
here's code of second script (nested one):
#!/bin/bash files=$1*/discover/*data file in $files sed 's/"\([^"]*\)"/"foo"/' $file > $file\_2 sed -i 's/"foo",//g' $file\_2 sed -i 's/[0-9]g//gi' $file\_2 sed -i 's/[^,.0-9]//g' $file\_2 done
note-> files in folders:
../espn/2g.tf/discover/
../espn/2g.tfidf/discover/
note-> files in folders:
../espn/2g.tf/discover/
../espn/2g.tfidf/discover/
what mean?? first file in first directory , second in second?? think problem path access second file
try calling second script using abslute path ('path begins /')
if espn in home folder
~/espn/2g.tfidf/discover/second_script.sh $format
try adding echo statments in second file make sure accessible
Comments
Post a Comment