LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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, 04: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, 05: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, 03: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



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-12-2005 11:07 PM
using perl (verbose?) jsheffie Linux - Software 2 09-06-2005 01:18 PM
verbose output of fstab-sync command GingerMegs Linux - Software 0 06-04-2005 04:25 PM
Bash: How to concatenate the output of different commands? J_Szucs Programming 1 11-13-2003 07:43 AM
Using commands to output to files, how is this done? nro Linux - Newbie 3 11-11-2003 08:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration