shell - bash chain string manipulations -


i have strings contains foo , end .txt:

myfoo.txt
foobar.txt
fizzfoobuzz.txt

i want replace them removing foo (${string/foo}) , .txt (${string:0:-4}):

my
bar
fizzbuzz

is there way chain both string manipulations instead of embedding them ? if there no bash answer possibility zsh, i'll interested.

by embedding mean:

for string in $(cat strings_file);     echo ${${a/foo}:0:-4} done 


Comments

Popular posts from this blog

python - Getting ESC characters and non-printables from UDP socket / buffer -

Convert excel to pdf with VBScript -