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

angular - DownloadURL return null in below code -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -