in reply to Why does system("mv $x $y") not work when it works at the command line?
The shell will normally treat [xyz] as a character class, and attempt to match filenames on that basis. But if it finds no file matches for the expansion, it will instead pass the original characters as the argument:
% ls t0 t1 % echo t[012] t0 t1 % echo t[xy] t[xy] %
It isn't entirely clear to me what your filename is, or what your code is doing, but I suspect the shell behaviour is causing the confusion.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
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 |