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

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -