_edge@discuss.tchncs.detoLinux@lemmy.ml•Perl rename command works at cli but not in alias or bash script
2·
9 days agoYour problem is most likely escaping. $1 has a meaning in regex and in shell. You want the former and the single quotes achieve this.
In your second example, with alias, probably the shell interpreting this replaces $1 with whatever the first arg in the shell environment is, probably the empty string.
Not sure what the problem with the shell script is. Anyway try escaping the $ as $ and \ as \.
You can see where you are wrong if you replace prename with echo for debugging. Or in a shell script do
set -ex
Yeah. That’s me. Or anyone I know, really. Sure cities are back to pre-pandemic chaos, but those are other people.
I choose to work from the office on most days. I use public transit. I go to the gym. I’m not locked in, but …
That’s a distant past. And i don’t miss it, really.
Ok, I do miss socializing, the good parts: Crack some jokes, have some small-talk, feel part oof a group of friends.
But i don’t miss it enough to endure that bad parts: Forcing oneselves into conversations with strangers, “networking”, drinking a beer alone in a corner of some event, going out to bar where over your overpriced drink you’ll accept that you’d rather be in your living room. Bars and night clubs are a weird concept (unless you are in your twenties and really enjoy the scene): You realistically only talk the person you came with, but they can’t hear what your are saying since it’s loud and crowded. There may be music, but unless you came to dance, you probably have a Spotify play list you’ll enjoy more. In better quality.