escription:/){
for (my $x = 0; $x < 5; $x++) {
print readline(INFILE) . "\n";
}
last;
}
}
close (INFILE);
-Tim
"Craig Sharp" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
01/31/2005 09:57 AM
To
cc
Subject
[Perl-unix-use
Hi all,
I know this is simple but I have having a brain lock today.
I have a file in which I need to find a particular line. Once I find the line,
I need to print the next 5 lines and quit.
The following gets me to the line but I am stuck from there.
#!/usr/bin/perl -w
open (INFILE,"filemon2
I need to be able to do the following from a windows machine:
1. Login to remote server via putty / SSH / Perl script
2. Automatically launch a script residing on the local system to send commands
to the remote host to start the proper software.
Seems pretty simple except I cannot find a way to
sprintf did the trick! Thanks to all who responded.
>>> "Craig Sharp" <[EMAIL PROTECTED]> 07/23/04 10:57AM >>>
I need to get 2 digit time and date in a scalar when there is only 1 digit.
Eg: Using printf with %02d, I am able to get 05 to print at 5 min pas
I need to get 2 digit time and date in a scalar when there is only 1 digit.
Eg: Using printf with %02d, I am able to get 05 to print at 5 min past the hour.
printf("%02d",$Minute)
I need to assign this output to a scalar variable so that I can use it as part of a
filename later in the code.
I need to come up with a way to do heavy system IO and processor load testing on a new
enterprise storage and blade server combination.
I would like to do this in Perl but I have no idea how or even if Perl can help me do
this. The testing must load the devices to as near max as possible.
Any h
I have an array of names. I need to find the corresponding index for a
particular name. How can I do this?
Thanks,
Craig
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Bill,
Can you please give and example?
Thanks,
Craig
>>> "$Bill Luebkert" <[EMAIL PROTECTED]> 12/01/03 09:29AM >>>
Craig Sharp wrote:
> It sounds simple but here is the situation.
>
> I have DB2 creating log files. Each file name is consecutive
It sounds simple but here is the situation.
I have DB2 creating log files. Each file name is consecutive.
Eg:
S628.LOG
S629.LOG
S630.LOG
S631.LOG
S632.LOG
S633.LOG
S634.LOG
S635.LOG
S636.LOG
S637.LOG
S638.LOG
S639.LOG
S640.LOG
The DBA wants m
Travis,
The attachment did not come through. Please try again or you can just
send it by email.
Thanks,
Craig
>>> Travis Hoyt <[EMAIL PROTECTED]> 11/07/03 01:57PM >>>
Here's our version for Oracle being backed up by Veritas NetBackup.
I tried to just cut and paste this but it isn't keeping
n files
here
close(DIR);
foreach my $file(@files)
{
my $now = time;
my @stat = stat("$dir/$file");
if ($stat[9] < ($now - 864000))
{
print "Deleting $dir/$file...";
unlink("$dir/$file");
print &qu
2003, at 08:00 PM, Michael A Nachbaur wrote:
> On Thursday 06 November 2003 04:36 pm, Craig Sharp wrote:
>> Hi,
>>
>> I guess the subject says it all. I have a set of directories on
Unix.
>> I need to remove all files that are older than 10 days from each
>
Hi,
I guess the subject says it all. I have a set of directories on Unix.
I need to remove all files that are older than 10 days from each
directory.
I am having a brain lock problem and cannot get started.
Any ideas would be a big help.
Thanks,
Craig
Hi all,
Can anyone send some examples of using shared memory with perl?
I know there are shmctl, shmget, shmwrite, etc. I would like to see
these used in practice.
Thanks,
Craig
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http:
I need to put a counter in a script that processes a file line by line.
I want the counter to alway stays on the same line on the console but
increment. This is to be a baby sitter so that the user can see the
numbers increase. I do not want to scroll but print the number, erase
and print the ne
Jimmy
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Craig Sharp
Sent: Monday, June 09, 2003 10:34 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] URGENT: Scan a directory and ftp if there
are
files
Hi all,
I need a example of scanning a directory on a s
Hi all,
I need a example of scanning a directory on a scheduled basis (crontab)
for files. If there are files in the directory, those files need to be
ftp'ed to a server and then deleted from the sending server. This is an
automated incoming mailbox for EDI and the data needs to be transfered
wh
print "$ENV{Ice_Cream}{Flavors}{Favorite}\n";
> -Original Message-
> From: Craig Sharp [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 05, 2002 13:28
> To: [EMAIL PROTECTED]
> Subject: [Perl-unix-users] Setting env variables?
>
>
> Hi all,
>
>
Hi all,
I have a huge pile of environment variables to set. If I set them in a separate perl
script and use the require function to reference that script, will the variables be
available to the calling perl script?
Thanks,
Craig
___
Perl-Unix-User
I have a simple question but I have brain lock.
I need to parse a file and remove all blank lines from the file.
Thanks,
Craig
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
GOT IT!
s/^\e//;
Thanks for all your replies.
Craig
>>> "Craig Sharp" <[EMAIL PROTECTED]> 07/30/02 02:04PM >>>
Hi all,
I have several lines that start as follows:
^[(s3B
I need to remove the ^[ from each line.
Beware that there are lines in the file t
Hi all,
I have several lines that start as follows:
^[(s3B
I need to remove the ^[ from each line.
Beware that there are lines in the file that do not begin as shown.
Thanks,
Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Roush Industries
Office: 734-466-6286
Cell: 734-231-6769
Thats exactly what I was looking for. I forgot about sprintf.
Thanks!
Craig
>>> "Adam Frielink" <[EMAIL PROTECTED]> 03/20/02 02:11PM >>>
> -----Original Message-
> From: Craig Sharp [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 20, 20
te::Calc has a Day_In_Month method which only requires the
year and month for paramters.
Adam
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Craig Sharp
> Sent: Wednesday, March 20, 2002 10:54 AM
> To: [EMAIL PROTECTED]
> Su
I need to be able to find the start and end dates for last month on the first of each
month.
Once found, I need to store them in variables in the format 2002-02-01, etc.
Does anyone have a script to do this or can you point me in the right direction?
Thanks,
Craig A. Sharp
Unix Systems Admini
Great thanks for your help :-)
Craig
>>> "Jenda Krynicky" <[EMAIL PROTECTED]> 03/18/02 10:21AM >>>
From: "Craig Sharp" <[EMAIL PROTECTED]>
> Jenda and Bill,
>
> Ok, I went out and generated a list of the environment
have set them in the require
file?
Thanks,
Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Roush Industries
Office: 734-466-6286
Cell: 734-231-6769
Fax: 734-466-6939
[EMAIL PROTECTED]
====
I have not lost my mind, it's backed up on tape somewhere!
Hi all,
In a shell programming, I can run a script with a period-space in front of the script:
Eg: . script_name.scr
This will cause the variables to be sourced to the parent process. In other words,
any variables that are created within the child process running the script become
available
Ok, here is a good one.
I need to be able to monitor a directory on an ftp server and then download the files
when they have been uploaded to the server.
The problem is how to determine when a file is there and if a file is there, that the
file is done being uploaded from the source.
I was go
Fixed. The replies to my request indicated that I was using a hash { } instead of an
array [ ] like I needed.
What a dumb mistake!
Thanks for all your help!
Craig
>>> "Craig Sharp" <[EMAIL PROTECTED]> 03/05/02 11:32AM >>>
I am having a problem with the fol
I am having a problem with the following script:
#!/usr/bin/perl -w
use strict;
use Spreadsheet::WriteExcel;
my $workbook = Spreadsheet::WriteExcel->new("unixsvrs.xls");
my $worksheet = $workbook->addworksheet();
my @date;
my @time;
my @device;
my @address;
my @count;
my $index;
my $data;
my
Dave and Phil,
Both of your solutions worked just great. Thanks for your assitance.
Craig
>>> Philip Andrew <[EMAIL PROTECTED]> 03/04/02 04:23PM >>>
Craig Sharp wrote:
>I am trying to parse a file with the following script:
>
>. . . .
>
>1. Loo
Hi all,
I am trying to parse a file with the following script:
#!/usr/bin/perl
use strict;
open
ON';
$exts{$ext} += -s;
}
select DIROUT;
for (sort keys %exts) {
print "$_=>$exts{$_} bytes\n";
}
Enjoy!
Thanks for the help!
Craig
>>> Jim Angstadt <[EMAIL PROTECTED]> 01/21/02 04:20PM >>>
--- Craig Sharp <[E
;> Jim Angstadt <[EMAIL PROTECTED]> 01/18/02 03:00PM >>>
--- Craig Sharp <[EMAIL PROTECTED]> wrote:
> Jim,
>
> Thanks for the reply. Interesting code. This sure
> is a learning experience :-)
>
> I tried to run the code on win2k and received the
>
This question will be used for win32 file tree but will also apply to unix so I am
posting here.
We have had a request to generate a report for total space usage by file type
(extension) within a directory tree.
Eg: Start at the top of the tree, look at all the file types by extension and
Correct, the variables are special variables for Informix and Peoplsoft.
>>> Peter Eisengrein <[EMAIL PROTECTED]> 01/16/02 03:45PM >>>
you mean vars other than what is in %ENV ?
> -Original Message-
> From: Craig Sharp [mailto:[EMAIL PROTECTED]]
Hello,
I would like to be able to set variables by using a module.
The module would be simple but provide a list of variables such as:
$PSOFTDIR=/psoft/bin;
An example for the calling program would be:
#!/usr/bin/perl
use module_name;
print $PSOFTDIR;
Is there an easy way t
Hi all,
I have a file with lines that are in the following format:
20011219 074645 b03 3524 switch 10.3.xxx.xxx 3
I need to do a substitution so that the line appears as:
20011219 074645 b03-3524-switch 10.3.xxx.xxx 3
Note the inclusion of the dashes.
Here is another
Hi all,
Does anyone have experience with installing CPAN modules on a Novell Enterprise Web
Server?
Thanks,
Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Roush Industries
Office: 734-779-7282
Cell: 734-231-6769
Fax: 734-779-7807
[EMAIL PROTECTED]
=
I need to be able to install CPAN modules on a Netware Enterprise Web Server.
I have checked the Novell website and they say that you can install the modules but do
not give instructions.
Can anyone help me with this problem?
Thanks,
Craig A. Sharp
Unix Systems Administrator
Jonathan,
I like the second option but I am a bit unsure on opening the second connection part.
Can you expound on that area?
Thanks,
Craig
>>> Jonathan Leffler <[EMAIL PROTECTED]> 12/05/01 01:18AM >>>
Craig Sharp wrote:
>I am trying to u
27;t see why XML::Parser
failed to put the files in the right place to start with even though the
make test worked?
had anyone come across this problem or know a good place to start looking
for some help ?
TIA Geoff
If you need any info about the configuration of the AIX box, please ask
me...
I am trying to use DBD::Informix to query a remote database.
I am connected to a local database and then issuing a remote sql query:
select * from perf_info@roushprod:archive_info
roushprod is in the sqlhosts file. The statement works correctly outside of the
DBD/DBI functions.
I am trying to use DBD::Informix to query a remote database.
I am connected to a local database and then issuing a remote sql query:
select * from perf_info@roushprod:archive_info
roushprod is in the sqlhosts file. The statement works correctly outside of the
DBD/DBI functions.
Hi all,
I have several lines like the following in a file. I need to make a substitution for
the line.
I am reading the file into @lines. I then loop through looking for the line. When I
find the line, I need to make the change. Then I will write it out to a new file.
Here is
Thanks to all. All ideas are great and I was able to make the tables work as I need.
Craig
___
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users
I need to create a script that will use DBI to retreive information from Informix and
then present the information in a table in html.
The DBI part I have with no problem.
I need to use perl to create a table in html that will expand or reduce as needed
depending on how many rows are
edictable. e.g. It alway falls after UP.
If you cannot predict where the server name falls then it will be more
efficient to put the text that occurs least frequently on the left of the &&
as the right-hand side is only evaluated if the left-hand expression returns
true.
Stev
Hi all,
I am lost. I have the following script that opens the log file WUGEvent.log and looks
for the statment "UP", replaces spaces and writes out the new log file. It works
great!
Here is the problem. I need to read in another file (wuglist.txt) containing a list
of server names
Hi all,
I know this is a bit off subject but the question might help everyone. I need to be
able to list the running processes in NT or 2K (server and workstation).
Is there a simple way to script this in perl?
Thanks,
Craig A. Sharp
Unix Systems Administrator
DNS Adminis
I tried running the script in Linux on perl v5.6.0. Runs fine.
The script will actually be run on hpux with perl v5.6.0. There the script will not
run. I get the syntax error.
How about that for a wrench in the works?
Craig
___
Pe
Hi all,
I have the following short script that does not work:
#!/usr/bin/perl
@pvlist = qw{
/dev/dsk/c0t9d0
/dev/dsk/c0t10d0
/dev/dsk/c0t11d0
};
foreach (@pvlist) {
print "$_\n";
}
I am getting the following error:
syntax error in file pvcfg at line
Hi all,
Does anyone know where I can find info on Ncurses modules and how to program perl for
ncurses.
Thanks,
Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Roush Industries
Office: 734-779-7282
Cell: 734-231-6769
Fax: 734-779-7807
[EMAIL PROTECTED]
==
x27;t got much
to do with HP-UX. Any processes initiated by the script will have it set in
their environment.
hth,
Craig Arnold
Boeing Space and Communications
International Space Station
Guidance, Navigation and Control
Huntington Beach, CA
(714)896-3311 x68266
> --
Hi all,
I wrote a script in perl for hp-ux. The script was designed to check for a process
and compare the cpu to a threshold and then alarm if the threshold is exceeded.
Here is the problem. I need to set a hp-ux environment variable everytime the script
is run. The script will run
Hello,
I have several scripts that work fine in Linux (RH7) with apache. I am trying to move
the scripts to a Novonyx / Suitespot (Novell) web server and the scripts will not run.
I would appreciate any help in getting the scripts to work.
Thanks,
Craig A. Sharp
Unix System Administra
Hello,
I am using a form on my website for procedure submission. The form has several input
boxes for the user to enter information. The actual procedure input box may have
several lines that contain carriage returns. As an example, a numbered list of steps
to follow.
I am using the po
58 matches
Mail list logo