LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-18-2006, 05:41 PM   #1
selgan
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:

#backup.pl
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.

Thanks!
 
Old 02-18-2006, 06:09 PM   #2
DanTaylor
Member
 
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:
Code:
sytem("some_command");
 
Old 02-19-2006, 04:44 PM   #3
selgan
LQ Newbie
 
Registered: Oct 2005
Posts: 4

Original Poster
Rep: Reputation: 0
yeah...

that was too easy. thanks for the help!
 
  


Reply


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


All times are GMT -5. The time now is 11:43 PM.

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