in reply to Backticks to capture umask output
There is no umask executable.
$ perl -E'say `umask` // ( $! != -1 ? $! : sprintf("\$?=%04x", $?) );' No such file or directory
You are trying to execute a bourne shell command without involving a bourne shell. So invoke the shell:
$ perl -E'say `/bin/sh -c umask` // ( $! != -1 ? $! : sprintf("\$?=%04 +x", $?) );' 0077
Of course, you should just use the builtin umask.
$ perl -E'my $umask = umask; say defined($umask) ? sprintf("%04o", $um +ask) : $!;' 0077
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Backticks to capture umask output
by austin43 (Acolyte) on May 24, 2011 at 20:58 UTC | |
|
Re^2: Backticks to capture umask output
by austin43 (Acolyte) on May 24, 2011 at 20:56 UTC | |
by ikegami (Patriarch) on May 24, 2011 at 20:59 UTC | |
by ikegami (Patriarch) on May 24, 2011 at 20:58 UTC |