xjlittle has asked for the wisdom of the Perl Monks concerning the following question:
The directory certainly exists. If you would please look at my code and tell me where I have go awry:bash-2.05# ./ch_sunflare-beam.pl You are on sunflare Which ACLs would you like to apply to /mkt/sbo/inbound rwx You said rwx /mkt/sbo/inbound 1: No such file or directory bash-2.05#
Pleae let me know where my mistake is. Thanks! @gwadej Ok my mistake. I misread where that error was coming from. However I still do not change the ACLs on the directory when I run the script:#!/usr/bin/perl -w use strict; my @users = qw(ux43 ux95 ux61 ux10 ux78 vx14 ux26 vx20); my $users; my @dirs_sunflarebeam = "/mkt/sbo/inbound"; my $hostname = `hostname`; print "You are on $hostname\n"; print "Which ACLs would you like to apply to @dirs_sunflarebeam\n"; my $ans = <STDIN>; chomp $ans; print "You said $ans\n"; my @args = ("setfacl", "-m"); foreach my $dirs(@dirs_sunflarebeam){ print "$dirs\n"; <==this prints ok however the $dirs fai +ls below with the message posted above: system(@args, "u:$users[0]:$ans", "$dirs") == 0 or die "system @args failed $?"; # system(@args, "u:$users[3]:$ans", $dirs) == 0 # or die "system @args failed $?"; } my $dir = @dirs_sunflarebeam; #print "$dirs\n"; system("getfacl", "$dir");
bash-2.05# getfacl /mkt/sbo/inbound # file: /mkt/sbo/inbound # owner: mkt # group: mkt user::rwx user:ux10:rwx #effective:rwx user:ux438:rwx #effective:rwx user:pdev:rwx #effective:rwx group::rwx #effective:rwx mask:rwx other:rwx bash-2.05#
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Correct way to use system()?
by gwadej (Chaplain) on Aug 13, 2009 at 17:13 UTC | |
by xjlittle (Beadle) on Aug 13, 2009 at 17:40 UTC |