R
robertchen117
hi all,
In a Unix server,
#cd /tmp
# ls -l| awk '{print $1" "$5" "$9}'
total
-rw------- 159045 1IUPKPnHDb
-rw------- 1287908 1Mbi68lSf3
-rw------- 1475 1o3Bj5Dc1G
....
My perl is:
#!/vendor/perl/bin/perl
#`ls -l| awk '{print $1" "$5" "$9}' > /tmp/ls.out`; #This does not
work!
#system("ls -l| awk '{print $1" "$5" "$9}' > /tmp/ls.out");
#compilation error
system("ls -l| awk '{print $1\" \"$5\" \"$9}' > /tmp/ls.out"); #The
File is generated but with empty lines.
I tried the above 3 commands all failed.
How to put the command ls -l| awk '{print $1" "$5" "$9}' in a perl
script?
Thanks.
In a Unix server,
#cd /tmp
# ls -l| awk '{print $1" "$5" "$9}'
total
-rw------- 159045 1IUPKPnHDb
-rw------- 1287908 1Mbi68lSf3
-rw------- 1475 1o3Bj5Dc1G
....
My perl is:
#!/vendor/perl/bin/perl
#`ls -l| awk '{print $1" "$5" "$9}' > /tmp/ls.out`; #This does not
work!
#system("ls -l| awk '{print $1" "$5" "$9}' > /tmp/ls.out");
#compilation error
system("ls -l| awk '{print $1\" \"$5\" \"$9}' > /tmp/ls.out"); #The
File is generated but with empty lines.
I tried the above 3 commands all failed.
How to put the command ls -l| awk '{print $1" "$5" "$9}' in a perl
script?
Thanks.