Sponsored Content
Full Discussion: Perl script issue: print
Top Forums Shell Programming and Scripting Perl script issue: print Post 302323998 by man on Tuesday 9th of June 2009 02:44:08 PM
Old 06-09-2009
Great! That worked perfectly.. THX!

Here is my finalized perl multiple file copy script for reference (if anyone else has the same issues)

Code:
#!perl.exe

use strict;
use File::Copy;

my @sub_dir = ("sqr","src","user","nvision","winword","crw","excel","maint","projects","scripts","data");

print "\nEnter source directory";
chomp (my $source_dir = <STDIN>);

print "Enter destination directory";
chomp (my $dest_dir = <STDIN>);

foreach (@sub_dir) 
   {
   my @source = glob("$source_dir/$_/*");
   my $destination = "$dest_dir/$_";
   
      foreach my $file (@source)
      {
      print "copying files from $source_dir to $dest_dir... please wait.\n";
      copy ($file, $destination);
      }
   }

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl - why is the shell script executed before the print command?

i'm writing some simple scripts to help me learn perl. why does the print command get called after the shell script is executed? the purpose of the shell script is to simply echo to the screen "script run". which is does, but before the print command, you can clearly see the shell script is... (3 Replies)
Discussion started by: mjays
3 Replies

2. Shell Programming and Scripting

Perl Script Issue - Please Help * Thanks!!!

Please help me with my script please. I am trying to do the following: 1. Read files for the current directory 2. Open and read from nbe files files only 3. Read only the lines with the results pattern 4. Split the line and print 3rd field Please indicate what line I need to modify. ... (8 Replies)
Discussion started by: jroberson
8 Replies

3. Shell Programming and Scripting

Perl Script issue. What am I doing wrong?

#!/usr/local/bin/perl open (MYFILE, 'logs_report'); while (<MYFILE>) { $rec=$_; chomp ($rec); @arr=split(/ /,$rec); print $rec,"\n" if ($arr!~/OK/); open (MYF, '>data.txt'); print $rec,"\n" if ($arr!~/OK/); close (MYF); (14 Replies)
Discussion started by: SkySmart
14 Replies

4. Shell Programming and Scripting

Perl Print Problems in script

Hi Perl Gurus, perl -e 'print "http://www.site@domain.com"' The output of the above is : http://www.site.com" I want to print http://www.site@domain.com without using escape sequence before '@' like '\@'. Is there any way to do this in perl? Thanks, Som (1 Reply)
Discussion started by: som.nitk
1 Replies

5. Shell Programming and Scripting

Perl Script - Print Content of next line

Good evening to you all perl experts I need your help I have a very simple script where I´m trying to print a line from status.dat file. The script will find the line containing "servicestatus", and I want to print the content of the next line. For example, the file contains this text:... (6 Replies)
Discussion started by: zarahel
6 Replies

6. Shell Programming and Scripting

how to print out data from mysql table in perl script

I'm having trouble with this code. if i do .\read.pl -u user it prints out 2010-12-20 12:00:00 host1 <cmd>a 2010-12-20 12:00:01 host1 <cmd> <execute> 2010-12-20 12:00:02 host1 <cmd>b 2010-12-20 12:00:03 host1 <cmd>c however, if i enter .\read.pl -h host1 it should... (3 Replies)
Discussion started by: kpddong
3 Replies

7. Shell Programming and Scripting

Perl :How to print the o/p of a Perl script on console and redirecting same in log file @ same time.

How can i print the output of a perl script on a unix console and redirect the same in a log file under same directory simultaneously ? Like in Shell script, we use tee, is there anything in Perl or any other option ? (2 Replies)
Discussion started by: butterfly20
2 Replies

8. Shell Programming and Scripting

Perl script issue

Hi All, I have a perl script which I am using in Windows environment. There is one more file called "functions.txt" which is having all the functions defined to used in my perl script. And the path for this function file is defined in my perl script. Howeever sometimes I am getting below error... (4 Replies)
Discussion started by: gr8_usk
4 Replies

9. Shell Programming and Scripting

Issue regarding dos2unix perl script

Hi All, I have pearl script which will check and convert the file: INFO("dos2unix_cmds".$#{$dos2unix_cmds}); if ( $#{$dos2unix_cmds} == 0 ) { my $convert_cmd = $$dos2unix_cmds; my $rename_cmd = $$dos2unix_cmds; --conversion going here else INFO ("No need to... (8 Replies)
Discussion started by: saps19
8 Replies

10. Shell Programming and Scripting

perl script print the lines between two pattern

i have a file as below sample.pl parameter1 argument1 argument2 parameter2 I want out as below argument1 argument2 that is , i want to print all the lines between parameter1 & parameter 2. i tried with the following if($mystring =~ m/parameter1(.*?)parameter2/) (2 Replies)
Discussion started by: roopa
2 Replies
ib_acme(7)							      ib_acme								ib_acme(7)

NAME
ib_acme - test and configuration utility for the IB ACM SYNOPSIS
ib_acme [-f addr_format] [-s src_addr] -d dest_addr [-v] [-c] [-P] [-S svc_addr] [-C repetitions] ib_acme [-A [addr_file]] [-O [opt_file]] [-D dest_dir] [-V] DESCRIPTION
ib_acme provides assistance configuring and testing the ibacm service. The first usage of the service will test that the ibacm is running and operating correctly. The second usage model will automatically create address and configuration files for the ibacm service. OPTIONS
-f addr_format Specifies the format of the src_addr and dest_addr parameters. Valid address formats are: 'i' ip address, 'n' host name, 'l' lid, 'g' gid, and 'u' unspecified. If the -f option is omitted, an unspecified address format is assumed. ib_acme will use getaddrinfo or other mechanisms to determine which format the address uses. -s src_addr Specifies the local source address of the path to resolve. The source address can be an IP address, system network name, or LID, as indicated by the addr_format option. -d dest_addr Specifies the destination address of the path to resolve. The destination address can be an IP address, system network name, or LID, as indicated by the addr_format option. -v Indicates that the resolved path information should be verified with the active IB SA. Use of the -v option provides a sanity check that resolved path information is usable given the current cluster configuration. -c Instructs the ACM service to only returned information that currently resides in its local cache. -P Queries performance data from the destination service -S svc_addr address of ACM service, default: local service -C repetitions number of repetitions to perform resolution. Used to measure performance of ACM cache lookups. Defaults to 1. -A [addr_file] With this option, the ib_acme utility automatically generates the address configuration file ibacm_addr.cfg. The generated file is constructed using the system host name and any IP addresses that are assigned to IPoIB device instances. -O [opt_file] With this option, the ib_acme utility automatically generates the option configuration file ibacm_opts.cfg. The generated file is currently generated using static information. -D dest_dir Specify the destination directory for the output files. -V Enables verbose output. When combined with -A or -O options, ib_acme will display additional details, such as generated address information saved to the ibacm_addr.cfg file. NOTES
The ib_acme utility performs two main functions. With the -A and -O options, it automatically generates address or options configuration files. The generated files are text based and may be edited. These options are intended to provide a simple way to configure address and option information on all nodes on a cluster. The other function of the ib_acme utility is to test the ibacm service, including helping to verify that the service is usable given the current cluster configuration. The ib_acme utility can resolve IP addresses, network names, or IB LIDs into a path record. It can then compare that path record against one obtained by the SA. When used to test the ibacm service, the ib_acme utility has the side effect of loading the ibacm caches. Multiple, numerical destinations can be specified by adding brackets [] to the end of a base destination name or address. Users may spec- ify a list of numerical ranges inside the brackets using the following example as a guide: node[1-3,5,7-8]. This will result in testing node1, node2, node3, node5, node7, and node8. SEE ALSO
ibacm(7), ibacm(1) ib_acme 2013-06-21 ib_acme(7)
All times are GMT -4. The time now is 02:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy