Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-18-2006, 05:41 PM   #1
LQ Newbie
Registered: Oct 2005
Posts: 4

Rep: Reputation: 0
want perl to output shell commands verbose

I've been working on a little backup script that copies and entire drive to a directory and then runs a virus scan on that directory. I cannot get perl to output copy progress to the screen. Essentially I want the effect of "cp -R -v /source /dest" if I were at the command prompt. Here is my code:
use Shell qw(cp cat df chmod mkdir mount freshclam clamscan);
cp ("-v", "-R", "$source", "$dest");
clamscan ("$dest", "--remove", "--recursive", "-l", "$path/logs/$folder.log");

I've tried variations such as
print cp ("-v", "-R", "$source", "$dest");
cat cp ("-v", "-R", "$source", "$dest");

... and still no luck.

It'd be nice to have the clamscan command do the same. I'm not a regular perl programmers, so any suggestions would be useful.

Old 02-18-2006, 06:09 PM   #2
Registered: Jan 2006
Distribution: Debian Sarge
Posts: 265

Rep: Reputation: 30
What do you mean by output the copy progress? Do you want the command's output or your own? If you want the command's output, you can just do this:
Old 02-19-2006, 04:44 PM   #3
LQ Newbie
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0

that was too easy. thanks for the help!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Output commands when programs run? TKS Slackware 2 12-13-2005 12:07 AM
using perl (verbose?) jsheffie Linux - Software 2 09-06-2005 02:18 PM
verbose output of fstab-sync command GingerMegs Linux - Software 0 06-04-2005 05:25 PM
Bash: How to concatenate the output of different commands? J_Szucs Programming 1 11-13-2003 08:43 AM
Using commands to output to files, how is this done? nro Linux - Newbie 3 11-11-2003 09:38 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration