Programming :: Can Perl Move X Amount Of Directories

Jan 8, 2010

I'm in the midst of making a perl script and I was wondering if it was possible, to say, have a folder with 20 files in it, then move 5 files out of there, into a new one. I would like to to do this until the original folder has no more files in it, but I'm very stuck.

View 3 Replies


ADVERTISEMENT

Programming :: Perl Script To Count Files And Directories Is Not Working?

Aug 26, 2010

I am new to perl scripting and wrote a perl script to read the directories and files and count the no of files in each directory and generate a log file. The problem is it is not printing anything to the log file. I am copying the script below.

!/usr/local/bin/perl
$dir= 'c:My ProjectsPerl ScriptsNew Folder' ;
$directory_count = 0;
$file_count=0;

[code].....

View 14 Replies View Related

CentOS 5 Server :: Move 5.5 To /usr/bin/perl So Root Based On Perl 5.12.1?

Aug 11, 2010

I am new here and want to lern CentOS. Current I have installed CentOS 5.5 x64 and Perl 5.8.8. Now i have install Perl 5.12.1 which located to /usr/local/bin/perl. But how I can move it to /usr/bin/perl so root based on Perl 5.12.1?

View 7 Replies View Related

Programming :: Perl - Directories Given To Opendir Via Foreach Give "No Such File Or Directory" Error

Feb 19, 2009

I'm writing a perl script to remove a test database and part of that is of course getting rid of all files. So I wrote this to do the job:

Code:

This always results in an "Could not open /u00/app/oracle/product/10.2.0/rdbms/dbs for reading: No such file or directory" (that directory is the one ending with the $spfile_dir variable) message, although that directory exists and the executing user has writing rights on it.

The same behaviour if I create the directory array like this:

Code:

The problem does not occur when one of the directories is the only element in the array though. Of course I could copy and paste that part of the script for the second directory, but I don't like that workaround.

View 1 Replies View Related

General :: Move Some Of The Files From Multiple Directories To One Location?

Jun 17, 2010

I'd like to move a selection of files from all the sub-directories within an overall directory to a single destination. I don't want any of the directory structure, just the files themselves. This is what I tried so far:

mv /dir1/*/igs*.sp3.Z /dir2

There are other .sp3.Z files in the * directories within /dir1 but I just need the ones that start with igs..

View 4 Replies View Related

Ubuntu :: Move Logs From Multiple Directories Into One And Avoid Name Collisions?

Jan 25, 2011

What I need to do is gather a bunch of log files from various directories and move them into one spot. Below shows the directory structure.Quote:

dir1
-a.log
-b.log

[code]....

View 4 Replies View Related

General :: Back Up Scrip - Find / Cp / Md5sum / Rm - Move All Files And Directories

Oct 22, 2010

I want to move all files and directories that are 1 month old out to back up into a separate folder. There will be a lot of files and I want to make sure it copies properly. The problem I'm having is integrating a MD5SUM into it to check integrity. MD5SUM is not recursive, so I figured it would work in a loop when it copies each individual file, I'll do a md5sum on each file and delete that md5 once its verified it copied ok.

[Code]...

I also need some sort of error handling to output all md5's that didnt pass the hash check.

View 3 Replies View Related

General :: SFTP Chroot - Unable Move Directories To Other Locations Of The System

Sep 26, 2010

I tried setting up sftp for my users. Each of my user have their home directory at "/var/www/public_html/$USER". When my users are using sftp, they can only see their own directories and unable to move to other locations of the system. I followed through the following tutorials: [URL]

The users are able to sftp into the system successfully. However, they are able to see the whole system. Somehow, it appears that the users are not jailed in their home directory although in the tutorial it states otherwise. The difference of my system against the tutorial is that I am using Dropbear for SSH server while it is using Openssh server. Although dropbear does not support sftp, I am able to login through sftp through the use of sftp-server. For the internal mechanics, I am not sure how though.

Assuming that when I tried to SFTP, the sftp-server is ran with the sshd_config, then everything should be working fine right? Do i need to run chroot command at all? The following is the procedure I used to attempt the objective:

1) Add a new user to the group: SFTPonly
2) Chown user:SFTPonly user/home/directory
2) Modify the sshd_config to what is reflected in the tutorial and other paths.

View 1 Replies View Related

General :: Get Output Of Text File Containing Account Number, Debit Amount, Credit Amount,date Using Shell Script?

Apr 9, 2011

How to get output of text file containing account number, debit amount, credit amount,date using shell script?

View 1 Replies View Related

Programming :: Checking Amount Of System Memory?

Nov 8, 2010

I need to allocate a % of the total system memory for a buffer but what is the best method to determine how much memory is in the system? So far the only way I have found is to get the pages of memory:

Code:
long sysconf(_SC_PHYS_PAGES)
Is that the only option?

View 2 Replies View Related

Programming :: Calculate The Amount Of Data Had Been Download?

May 3, 2011

i'm trying to write a program with c socket programming,what i am trying to reach is a program which will calculate a computer's downloaded data from the internet,just to know how much he/she download?

View 1 Replies View Related

Programming :: Possible To Know The Amount Of Memory Used By A Program Before Running It?

Mar 3, 2009

I would like to know if there is a linux command to verify the amount of memory used by a program. The programs I am using were compiled with gfortran.

View 2 Replies View Related

Programming :: Total Amount Of Allocated SHM Memory?

Aug 25, 2010

Is there an easy way in C to get the total amount of allocated SHM memory on a machine?

View 7 Replies View Related

Programming :: Call A Vbscript From Another Vbcrip Running X Amount Of Times?

Jan 6, 2011

I need to call a vbscript from another vbcrip running X amount of times.

View 1 Replies View Related

Programming :: Write A Script To Calculate The Total Amount Of Installed Memory?

Apr 4, 2011

I am trying to write a script to calculate the total amount of installed memory to use during an anaconda kickscript, so the swap file is created at 2 x the installed memory. I so far have the amount of installed RAM DIMMS but need a way to total them up and produce a varible I can use in the pre section of the install.

Code:

dmidecode -t 17 | grep Size | awk ' { print $2 }'
Output:
2048
2048

Note: on some servers there could be from 1 DIMM up to 16 DIMMS installed so the script needs to be able to handle this. I also can not use bc as it does not exist during the install stage. I am guessing I need a while loop to do this and use expr but do not know where to start for this logic.

View 3 Replies View Related

General :: Creating A Script To Move Or Copy Files Into Multiple Directories Below The Files?

Aug 25, 2009

How can you create a script to move or copy files from a main directory into multiple directories below the main directory.

View 7 Replies View Related

Programming :: Socket Programming In Module Perl

Jul 21, 2010

Where is the perl module for programming with sockets?

View 4 Replies View Related

Programming :: Cannot Install Perl / Tk

May 9, 2010

I just downloaded Tk-804.028 and try to install it (according to the README.linux) but I get:

> perl Makefile.PL
/opt/ActivePerl-5.10/bin/perl-static is installed in /opt/ActivePerl-5.10/lib okay
PPM for perl5.010001
Test Compiling config/perlrx.c
Test Compiling config/pmop.c
Test Compiling config/pregcomp2.c

[code]...

View 5 Replies View Related

Programming :: Perl Tutorial To Use?

May 18, 2011

Any recommendations on what Perl tutorial to use?

View 1 Replies View Related

Programming :: Converting MB/TB To GB In Perl?

Jan 30, 2010

I am taking an input from the user for free and Used capacity in a disk. I wish to convert Input entered in MBTB to GB and this is how i am doing it.

Code:

<some code>
print "Enter Total disk space";
$tot = <STDIN>;
convert($tot);

[code]...

how do i pass the value of conv[0] after conversion back to $tot or $use such that they contain only value which is in GB?

View 3 Replies View Related

Programming :: How To Get Perl Qt4 Working

Jul 24, 2010

I really would like Perl Qt4 bindings. The best I could find is this:[URL]The problem is that the sources would not compile, and the RPMs are for 32-bit machines.Is there really no such thing as good Perl Qt4 bindings?

View 8 Replies View Related

Programming :: MP3 - Tag And Perl Script

Mar 27, 2011

I am a newbie on linux and just searching everything about perl scripting and modules nearly 3-4 days. I need a perl script but one of not easy to find on searching google. Okay now I need a perl script which create or recreate (edit) id3 tags (artist, comment, album, year, cover) of mp3 files stored on my linux centos server. I installed MP3::Tag version 1.13 pearl module to my server. I Searched tutorials about how to use it, finally I get through reading id3 tag of mp3 file but not achieve to modify it or create a new id3tag.

These are the details:
I have a mp3 file called 1.mp3 this script will process that '1.mp3' file read its id3tag if there is one, than modify or create id3tag for it by my fix artist name for example:
'1.mp3' files id3 tag details are like this
Artist: Dj xx
Year:2010
Title:yyyyy
Comment:eerwer
Cover: x.jpg

Now via this perl script which uses MP3::TAG I will change it's
artist as YYY
Title:ttt
Comment:cool
Cover:t.jpg
these are gonna be my fixed values. I mean all '1.mp3' file will have same artist based on script value.

The reason of this script is I will share Dj podcasts on my server and Dj's would have upload their mp3's which has got different id3 tags and cover pics. etc. I want to create more organized podcasts of them by the way I would trigger this perl script via Cronjob.

View 14 Replies View Related

Programming :: How To Generate MD5 / Sha-1 With Perl

Mar 31, 2010

How can I generate a md5 or sha-1 code with perl?

View 2 Replies View Related

Programming :: Get The Directories Of A Directory?

Apr 4, 2011

I need to walk in folder recursively in C. To change the directory, I can use chdir, but how I can get the directories of a directory?

View 3 Replies View Related

Programming :: Perl - Interpreter For Fib Numbers

Apr 1, 2010

As some of you know that I am new to this forum. I have another problem that I got stuck on. I have this file called "Fib.rbb" and my instructor told us to write an interpreter program by using Fib.rbb.

"You are to write an interpreter in Perl for Rongs Basic Basic (RBB) as explained in class. The BNF description for RBB and a test file called Fib.rbb are part of the RBB.zip file which is available in the Course Documents folder on blackboard. If you call your interpreter myIntp.pl, you would execute the program via perl myIntp.pl Fib.rbb

Code: Print "A few Fibonacci numbers:"

View 3 Replies View Related

Programming :: Unable To Find The Perl

Mar 9, 2011

Just installed Fedora 14. I wanted to try "Hello World" with perl. But where is it?

Code: [user]@user bin]$ ls

View 1 Replies View Related

Programming :: Perl From USB Pen To Run On Both Linux And Windows

May 23, 2011

Im somewhat new at perl and was wondering if there was a way to run a perl script or tool made from perl, from a USB pen that would work both on Linux and on Windows?

View 1 Replies View Related

Programming :: 404 Not Found With Perl/cgi Script

Jan 16, 2010

I writed my home.html page in /var/www with following form:

Quote:

<form action="/cgi-bin/login.cgi" method="get" class="form-font">
<label>Already you registered?</label><br/><hr/><br/>
<fieldset><br/>
<legend>Insert your account</legend>
Email: <input type="text" name="email"/><br/><br/>

[Code].....

View 2 Replies View Related

Programming :: Add Folder To Perl Path?

Jun 8, 2010

I'm the server guy which is why I don't know this, but were staging a new webserver and we use some custom perl scripts and as were moving the site over for testing, apache is blowing a perl error;Can't locate web.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /home/mcp/htdocs/cgi-bin/newgraph.gif line 11.,Now I can copy that file local, but there are a bunch of things, so the question is how do you globally add a folder to the perl search path

View 1 Replies View Related

Programming :: Adding Mod-Perl And Using Apache ASP?

Sep 16, 2010

I have a debian lenny machine that I am trying to add mod_perl to and use apache asp on. I have had a range of failures on it. Is ther a way I can build apache2 with mod_perl in it? Instead of separate. Apache2 is built with some modules built in by default, how can I make mod_perl one of them?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved