I am using a mac for this.
I was giving a go at ‘Study Drills’ in ‘Exercise 5’ removing my_ and wanted to test out a function I learned when preparing for the book: sed.
My understanding is that I can substitute characters, delete lines, but I was not able to delete the characters ‘my_’ successfully and wanted to know the lazy way to delete them.
I tried running a shell script to remove ‘my_’:
echo "Enter file name using sed" read fileName if [[ -f $fileName ]] then sed '/my_/d' $fileName else echo "$fileName does not exist." fi
And this just printed the script out in my terminal, no changes. (WHY print it out?!)
I also attempted to run sed ‘/my_/d’ $fileName on the Terminal and that was weird as hell because it ended up printing just a couple of lines (WHY?!):
$ sed '/my_/d' ex5.txt print(f"Actually not too heavy.") # this line is tricky, try to get it exactly right
After looking up in a browser, videos, walked away for a bit… I just cannot figure this out.
Any guidance will be appreciated.
Thank you for your time.