![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cleaning core files | ghost01 | UNIX for Dummies Questions & Answers | 5 | 04-19-2009 07:11 PM |
| content need changes- many files | swchee | Shell Programming and Scripting | 3 | 10-05-2006 01:29 PM |
| cleaning log files | rocker40 | UNIX for Dummies Questions & Answers | 6 | 10-15-2003 03:19 PM |
| Compare the content of 2 files | odogbolu98 | Shell Programming and Scripting | 3 | 09-10-2002 12:44 PM |
| Cleaning text files | ferretman | UNIX for Dummies Questions & Answers | 5 | 12-20-2001 09:47 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Cleaning the content of log files
Hi,
I am facing problems while trying to clean a log file(Means making its file Size zero). I am not the owner of this file. From the command line, I can clean it by becoming a Sudo. (">logfilename"). I want to automate it using perl. But inside a script, sudo somehow doesnt seem to work. Since I have to do this operation several times in the programs, its inconvenient to the the "Sudo" package provided by Perl as I need to set all the values of the Sudo structure everytime with different parameters. The Sudo package is like this: use Sudo; my $su; $su = Sudo->new( { sudo => '/usr/bin/sudo', sudo_args => '...', username => $name, password => $pass, program => '/path/to/binary', program_args => '...' } ); $result = $su->sudo_run(); So, setting the atrributes of Sudo object everytime is inconvenient. Is there any work around for it? I am using a BSD box and using bash as my shell. Thanks, Jyoti |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|