for FILE in /data/intervals/*.txt; do
ID=echo ${FILE}
/data/bin/Tool -a /data/check.txt -b ${FILE} > /data/final/Outputed_${ID}
done
Giving:
-bash: /data/intervals/CT.BP.200.txt: Permission denied
-bash: /data/final/Outputed_${ID}: ambiguous redirect
-bash: /data/intervals/CT.BP.500.txt: Permission denied
-bash: /data/final/Outputed_${ID}: ambiguous redirect
-bash: /data/intervals/CT.BP.50.txt: Permission denied
-bash: /data/final/Outputed_${ID}: ambiguous redirect
....
etc.
I can’t spot any typo error. Can someone help me with this?
does not do what you think it does. It actually sets the
IDenvironment variable to the valueechothen tries to execute${FILE}, hence the permission denied.If you want to set
IDbased onFILE, you need something like one of:or, if you just want it set to
FILEitself:But, in that case,
IDis probably unnecesasary and you can do something like: