Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: netman4u
  • Content: Threads
  • Order by date
  1. netman4u

    Simple substitution not working

    I don't understand this. I have a text file I am trying to do a substitution for that is not working: #!/usr/bin/perl my $out_file = "/etc/default/ovpa"; open (OUT, "$out_file") or die ("Error opening ovpa file $1"); while(<OUT>) { chomp; s/MWA_PROTOCOL/IT WORKED/g; } Here is the file...
  2. netman4u

    Net::FTP, print debug output to a handle

    Hello all, I have a program that basically does an FTP get of a file from a server, deletes some stuff from the file and then does an FTP put to another server. My script is working correctly but I would like to be able to print the FTP debug output to a logfile. Here is one of the FTP...
  3. netman4u

    Net::FTP put hanging

    Hello all, I have a script that uses the Net::FTP module to do some gets and puts. The gets are working fine but the puts are hanging. Here is the debug output: FTP Debug output: Net::FTP=GLOB(0x403fdb54)<<< 220 Microsoft FTP Service Net::FTP=GLOB(0x403fdb54)>>> user massmutual\weblog...
  4. netman4u

    Code not working, but it should!

    Hello all, Below is a snippet of code I am working on. use strict; open (PREFIX, "/home/mt71124/scripts/tws_prefix.txt") or die ("Error opening prefix file: $?"); my ($cpu, $sched_name, $job_name ) = @ARGV; my $count = scalar(@ARGV); chomp ($cpu,$sched_name,$job_name); my $prefix; print...
  5. netman4u

    Problem with simple script

    Hello all, I am trying to get a script to work that I did not write. It looks like it should be working: #________________________________________________________________________ # Program: CPU3_check # # This script checks the CPU utilization of a system against # a predetermined threshold...
  6. netman4u

    Need help with regex

    Hello all, I have a script I am working on that looks to me like it should be working but it does not. It takes 4 variables from the command line, opens up a config file and compares the command line args against the config file: use strict; use warnings; my $prefix = shift @ARGV; my $cpu...
  7. netman4u

    Help with default record separator

    I have the following code that is not working. The problem seems to be with what I am redefining the default record separator to. I know I have done this before in a while loop to change the scope of what a record is defined as. Any help is appriciated. use strict; use warnings; my $prefix =...
  8. netman4u

    Need to insert lines in a file

    Hello all, I have many text files I need to add a line at a certain point. A sample of the file is below: SYNTAX_VERSION 7 LOGFILE "ADSM/AIX logs" DESCRIPTION "ADSM backup message log on AIX" LOGPATH "/usr/lpp/adsm/bin/dsmsched.log" INTERVAL "15m" CHSET...
  9. netman4u

    Error checking with Net::FTP module

    I am using the standard Net::FTP code in a subroutine as in below: sub GetFTP { ########################################################################################## # # This subroutine performs an FTP Get using the Net::FTP module #...
  10. netman4u

    Need to delete a line while looping thrugh a file

    Hello all, I am writing a script that (in part) opens a file for reading and writing, loops through the file line by line looking for a specific strings. If it finds any of the strings I want to delete the line and go to the next line in the file (while loop). Here is what I have so far: my...
  11. netman4u

    Counting number of occurances

    Hello all, I have a script where I am running a very large text file being writen into an array. The seven element of that array is a hostname. There are many entries with the same hostname in the file. I want to count the occurances of each hostname and end up with an output like: hostname1...
  12. netman4u

    Can't locate loadable object for module

    Hello all, I am using the Crypt::CBC module to encrypt and decrypt some text files. I am using Blowfish encryption with CBC. When I run my program it can't seem to find the Crypt::Blowfish module. Here is the error: Couldn't load Crypt::Blowfish: Can't locate loadable object for module...
  13. netman4u

    Using Net::SSH to contact Cisco Routers

    Anyone have any sample code for using Net:SSH to connect to and run a sho command? Net:SSH does not seem to have a way to pass a password to log in and expects a certificate. On my test router I SSH to it and it asks me for a username and password so I do not think Net:SSH will work. I also...
  14. netman4u

    SSH to a cisco router and capture a show command

    Hello all, I am writing a perl script a part of which is to SSH to a router, run a show command and capture the STDOUT of the command. Can I do this with a shell command? I have tried: my $password = 'password'; my $user = 'auser'; my $ip = '100.152.201.22'; my $results=`"(echo $password) |...
  15. netman4u

    Cannot use /usr/local/lib! What to do?

    Hello all, I have just been informed that at this site I cannot install any libraries or modules n production systems under the /usr directory. I have been told that folks before have modified the Makefile.PL for the modules to specify a different directory such as one created under /opt/app...
  16. netman4u

    How to write &quot;die&quot; output to a logfile

    Hello all, My question is say I have die code like: [code] open (LOG, ">$log_file") or die ("Error opening log file $1"); or die $sth->errstr if $sth->err; or $scp->cwd("/tmp") or die $scp->{errstr}; [/code} How do I write the "die" output to a file handle instead of STDERR or both...
  17. netman4u

    Crypt::CBC decrypt to scalar not file

    Hello all, I got the following code of another post: use strict; use warnings; use Crypt::CBC; use FileHandle; Encrypt(); Decrypt(); sub Encrypt { open(CT,">ct.dat"); open(PT,"<pt.txt"); my $cipher = new Crypt::CBC({'key' => 't1234', 'cipher' => 'Blowfish'...
  18. netman4u

    Working with a %HoH returned from a subroutine

    Hello all, I am working on a script that reads a config file and loads it into a HoH as below: open (CFG, "$cfg_file") or die ("Error opening config file $cfg_file: $1"); # # Read config file, load a Vendor => Device Type => CLI hash of hashes. Count the entries. # my %cmd; my ($vendor...
  19. netman4u

    DBD::Oracle::db prepare failed: ORA-00933: SQL command not properly en

    I found another thread much like mine thread219-451673 but I am not sure how to "break up my statement". This SQL query was given to me to run in my script. Any ideas how to fix this? my $sth = $dbh->prepare( q{select T1.SVALUE, T2.SVALUE, T3.SVALUE from twtpropvalues T1, twtpropvalues T2...
  20. netman4u

    Creating a Hash of Hashes

    Hello all, I have the following config file I nees to load in a way that I can easily access the commands: # # # Vendor Device Commands # Foundry& IMG& show ip nat statistics,sho server sessions, , , , , , , , Foundry& DLB& sho server sessions, , , , , , , , , Cisco& BSR& , ,sho idb, ...

Part and Inventory Search

Back
Top