10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Greetings!
Been a while since I futzed around with Perl, and came upon a minor headscratcher for the community ;)
Here's the basic code which I'm trying to make tick over:#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
print " starting ";
while (-e "~/.somedir/testFile")... (9 Replies)
Discussion started by: LinQ
9 Replies
2. Shell Programming and Scripting
Hi ,
I'm trying to move/copy the files inside the loop into a directory .
I tried the below code and the issue is the data is not copying into the created directory but the files are copying into another file
file_path="/home/etc"
Last_Day=20130930
mkdir $file_path/ARC_${Last_Day}
... (3 Replies)
Discussion started by: smile689
3 Replies
3. Shell Programming and Scripting
I am trying to figure out a way to script copying specific files from one dir structure to another.
I have a dir structure like this:
dira/author 1/book 1/file a.epub
/book 2/file b.epub
/author 2/book 1/file c.epub
/author 3/book 1/file d.epub
/book 2/file... (2 Replies)
Discussion started by: arcanas
2 Replies
4. Shell Programming and Scripting
Good morning guys!!
Im still practicing with Perl and now Im trying to open a file, and copy its contents to another file. Them I want to remeove the information out of the orginal file after it is copied over.
The flow should be messages-->messages1-->messages2.
Kind of like a log... (1 Reply)
Discussion started by: bigben1220
1 Replies
5. Shell Programming and Scripting
Hi Folks,
I have one curious case. There are list of following files placed in one directory such as... And updated each month.
files.JAN09.csv files.FEB09.csv files.MAR09.csv .....
Now, I need to move a specific files; i.e,
For this month, I need to move only OCT09, NOV09, DEC09,... (1 Reply)
Discussion started by: Jerald Nathan
1 Replies
6. UNIX for Advanced & Expert Users
I am userB and have a dir
/temp1
This dir is owned by me.
How do I recursively copy files from another users's dir userA?
I need to preserve the original user who created files, original group information, original create date, mod date etc.
I tried
cp -pr /home/userA/* .
... (2 Replies)
Discussion started by: Hangman2
2 Replies
7. Shell Programming and Scripting
Hi Guys,
I need to count files in a dir which were updated yesterday.
ls -lth | grep -i 'Jul 7' | wc -l
The dir holds files of last 15 days and total count is as 2067476.
Is it efficient to count the files using perl? I have developed the following perl script making use of system().
Can... (3 Replies)
Discussion started by: Asteroid
3 Replies
8. Shell Programming and Scripting
Hello,
I'm new to shell scripting so I don't really understand what I'm doing wrong.
The script I'm trying to do saves all the files (*.c) on the current dir to a list and, one by one, copies them to a new one called Backup. The thing is, if there are already other versions of the files I'm... (6 Replies)
Discussion started by: G3nn
6 Replies
9. Shell Programming and Scripting
hi
i have a script
compareFiles()
{
find /tmp/Satya -type f | \
while read filename1
do
echo "----------------------------------------$filename1"
find /tmp/Satya -type f | \
while read filename2
do
if diff $filename1 $filename2
then
echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies
10. Shell Programming and Scripting
Folks, here is my code:
I am a serious newbie, why doesn't this make copies of my files? I dont get any errors, the files are just not created.
Your help is appreciated
#!/usr/bin/perl
use File::Copy;
$PWD = `pwd`;
$REPORTDIR = "/usr/local/tripwire/tfs/report";
chdir $REPORTDIR;... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies