Hello gracious monks,

I am writing a script using the system() function in perl. When I run the script I get the following output:
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#

The directory certainly exists. If you would please look at my code and tell me where I have go awry:
#!/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");

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:
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#

In reply to Correct way to use system()? by xjlittle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.