Yup, just use backticks (or system) to execute a command.

# untested
foreach $f (<*.*>) {
        `Dos2unix $f`;
        print "$f . " cleaned""
}

Rob

-----Original Message-----
From: Booher Timothy B 1stLt AFRL/MNAC
[mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 11:23 AM
To: [EMAIL PROTECTED]
Subject: simple command line execution


Is it possible to use a simple perl script to do simple unix commands.
(similar to the shell scripts)?

For example I want to run a unix command on all files in a current
directory:

Shell script (just pick dos2unix for example):

Foreach f (*.*)
        Dos2unix $f
        Echo $f . " cleaned"
Done

Thanks,

tim

____________________________________________________
Timothy B Booher, Lt USAF, AFRL/MNAC
101 West Eglin Blvd, Suite 339 
Eglin AFB FL 32542-6810 
Phone: 850-882-8302 Ext. 3360 (DSN 872-)
FAX: 850-882-2201


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to