Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: Why does system("mv $x $y") not work when it works at the command line?

by Fletch (Bishop)
on Feb 03, 2023 at 14:47 UTC ( [id://11150124] : note . print w/replies, xml ) Need Help??


in reply to Re: Why does system("mv $x $y") not work when it works at the command line?
in thread Why does system("mv $x $y") not work when it works at the command line?

This varies by shell. By default zsh will gripe if it can't find a match (although I think there's options enabled with setopt which will make it behave more like POSIX/ksh). For example the first works (because of course there's a file named foo . . . who doesn't have one?) but the second errors first and doesn't actually run the echo command.

oscar:~ 1064> echo fo[ob] foo oscar:~ 1065> echo fo[xy] zsh: no matches found: fo[xy]

The cake is a lie.
The cake is a lie.
The cake is a lie.