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

OT: catch the bash error?

Thread Next
From:
ToddAndMargo
Date:
August 4, 2018 05:08
Subject:
OT: catch the bash error?
Message ID:
ca29a588-2561-3ece-911d-ee7c413720b5@zoho.com
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!

Chuckle.

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.

-T










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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About