NetBSD-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: newfs ing wtih PERL -- dont work
On February 3, 2025 3:17:55 PM EST, Todd Gruhn <tgruhn2%gmail.com@localhost> wrote:
>...
> open(FH, '|-') || exec("/usr/pkg/bin/cdrecord" . $arg1 .
>$arg2); ## WORKED
>...
You're never reaching this line:
> open(FH, '|-') || exec ("/sbin/newfs_udf" . $arg3 . $arg4 .
>$arg5 ); ## BUUUT!
...
>I type it in by hand -- it works. IF PERL newfs the DVD, it dies.
>What is wrong here; what is the best way to do this??
>I do this in a root-prigram...
"The exec function executes a system command and never returns; use system instead of exec if you want it to return"
https://perldoc.perl.org/functions/exec
Also, though it happens to be ok with these particular args, it's dangerous to concatenate a command string instead of passing a list or args.
Home |
Main Index |
Thread Index |
Old Index