suppose you want to remove everything in a string after the character '_'
The command you would use would be:
i=<your string>
j=${i%%_*}
something i have used in the past.
for i in $(ls); do cd ../$i|cut -d '_' -f1; echo pwd; cd ../geo_color/; done
The command you would use would be:
i=<your string>
j=${i%%_*}
something i have used in the past.
for i in $(ls); do cd ../$i|cut -d '_' -f1; echo pwd; cd ../geo_color/; done