I\'m trying to parse file names in specific directory. Filenames are of format:
token1_token2_token3_token(N-1)_token(N).sh
I need to cut the t
You may use POSIX defined parameter substitution:
$ name="t1_t2_t3_tn1_tn2.sh" $ name=${name%_*_*} $ echo $name t1_t2_t3