I'm really not very good at bash scripting (because I would almost always to such things in Perl), but I guess that the initial $G is an error (there should not be a $ sigil).
2018-08-04 7:08 GMT+02:00 ToddAndMargo <toddandma...@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=" >