develooper Front page | perl.perl6.users | Postings from August 2018

OT: catch the bash error?

Thread Next
August 4, 2018 05:08
OT: catch the bash error?
Message ID:
Hi All,

I wanted to do a mass rename of "Apple.*" to "Mac.*" with
bash and I could not figure out the error.

I eventually did find it and I have to blame Perl for it!


for F in Apple*; do $G=$(echo $F | sed -e 's/^Apple/Mac/'); mv $F $G; 
echo "$F --> $G"; done

Did you catch the error?  I stared and stared at it for about
ten minutes.


It is "do G=" not "do $G="

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About