Skip to main content
tidied, and removed /g anchor from sed
Source Link
Jarrod
  • 111
  • 3

How about using grep? Try the following:

for f in *.txt
txt; do
out=$(echo $f${f} | sed 's/.txt$/_ended.txt/g'')
grep 'Trial End' $f > $out
done

How about using grep? Try the following:

for f in *.txt
do
out=$(echo $f | sed 's/.txt$/_ended.txt/g')
grep 'Trial End' $f > $out
done

How about using grep? Try the following:

for f in *.txt; do
out=$(echo ${f} | sed 's/.txt$/_ended.txt/')
grep 'Trial End' $f > $out
done
Source Link
Jarrod
  • 111
  • 3

How about using grep? Try the following:

for f in *.txt
do
out=$(echo $f | sed 's/.txt$/_ended.txt/g')
grep 'Trial End' $f > $out
done