Sponsored Content
Top Forums Shell Programming and Scripting Copy an array to a newly created directory Post 302788525 by Rashid Khan on Tuesday 2nd of April 2013 03:18:16 AM
Old 04-02-2013
Copy an array to a newly created directory

hello everyone,

I am new to perl script and trying to develop a script as follows.

I am trying to Create an array for storing all file names. I am trying to copy $libs[1] into "scratch". however i am unable to do so. Please suggest..



Code:
#!/usr/bin/perl

use File::Copy;

#use Archive::Zip qw( :ERROR_CODES );

$my_file = "makefile";
open(HANDLE,"<$my_file");

#$output_file = "libs.txt";
#open (OUTPUT, ">$output_file");


while(<HANDLE>)
{
	if(/check_geomtools.exe:/./\.lib$/)
	{
	 @libs = split(/: /);
	 @nlibs = $libs[1];
	 mkdir "Scratch";
	 foreach $my_libs(@nlibs)
	 {
		copy($my_libs, Scratch)
	 }

	}
	 	
}


close HANDLE;


Last edited by Rashid Khan; 04-02-2013 at 04:31 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to FTP all newly created but the current open file?

An application running on HP-UX constantly generates new text log files ( I think using logpipe ). Any new file created requires to be ftp'ed to an offline server, however I want to make sure that the current file being written should not be transferred. For examples consider the following files... (3 Replies)
Discussion started by: indianya
3 Replies

2. UNIX for Dummies Questions & Answers

Newly created files default group and write permissions

Whenever I create a new file the group name is "dnn" and the file permissions are "-rw-r--r--". How do I get it so when I create files (with vi or other programs) that the default group is "sss" and the permissions are 770? (I am running HP-UNIX) Thanks, GoldFish (2 Replies)
Discussion started by: goldfish
2 Replies

3. Shell Programming and Scripting

How to keep appending a newly created file based on some keywords

Hi Friends, I have to create a new log file everyday and append it with content based on some keywords found in another log file. Here is what I have tried so far... grep Error /parentfolder/someLogFile.log >> /parentfolder /Archive/"testlogfile_error_`date '+%d%m%y'`.txt" grep error... (6 Replies)
Discussion started by: supreet
6 Replies

4. Shell Programming and Scripting

To copy a a file to last created directory..Urgent pls

I need to copy a file example hhh.txt to the recently created directory by name flexite@latesttimestamp in the path interface/home/ ... I couldnt get the name of recently created directory .... first result of ls -lst ...that is ls -lst |head -2 gives the latest directory but i could not... (2 Replies)
Discussion started by: helloo
2 Replies

5. Shell Programming and Scripting

How to find the newly created directory

Hi, I need to create new directory by increasing the number by 1 of extracted lastly created directory. e.g. Log\out_log_1\ Log\out_log_2\ Log\out_log_3\ become Log\out_log_1\ Log\out_log_2\ Log\out_log_3\ Log\out_log_4\ Can anyone help how to do it in c-shell... (3 Replies)
Discussion started by: Andre_2008
3 Replies

6. Shell Programming and Scripting

sftp - get newly created files on incremental basis

Hi, We have a sftp server which creates files daily and keeps 6 months of files on the server. We are creating a daily job to get the files and load into database. My problem is "how to get ONLY those files which got created after my last get". Let me provide some more details to it. Below... (15 Replies)
Discussion started by: ravi.videla
15 Replies

7. UNIX for Advanced & Expert Users

default size of a newly created folder

Hi all, In linux how to create a directory with specified size, so that it can be used only up to the mentioned size. Actually my question is, whether we can do directory quota in linux. mounting the directory in a partiton will do that, but do we have any other option... (1 Reply)
Discussion started by: anishkumarv
1 Replies

8. Solaris

Can't see Newly created LUN by SAN admin

hello, i am an oracle DBA and trying to scan a newly created LUN of 200 GB on fiber channel by SAN admin.we have solaris 10 and SANtoolkit is installed.i tried following to get the new LUN at my machine. go /opt/Netapp/Santoolkit/bin and then ./sanlun lun show but i see only the existing... (12 Replies)
Discussion started by: janakors
12 Replies

9. Hardware

Formatting a newly created lun

Hi , I have created one new lun in my SAN storage and make it visible to my HP servers , but the fdisk -l output is somehow confusing. Do not know what to do next ---------- fdisk -l /dev/sdo1 Disk /dev/sdo1 (Sun disk label): 64 heads, 32 sectors, 10238 cylinders Units =... (7 Replies)
Discussion started by: mishra.sankar
7 Replies

10. AIX

No iscsi available in newly created AIX wpar

AIX 7.1 New to WPAR, hopefully just missing something simple here. Creating the WPAR like this..... (The box where the WPAR is hosted does have an iscsi protocol device) mkwpar -h wpar08 -l -n wpar08 -N interface=en0 address=xxx.xx.xx.xxx netmask=255.255.255.0 -D devname=/dev/iscsi0 -D... (0 Replies)
Discussion started by: TomR
0 Replies
libgnutls-config(1)						   User Commands					       libgnutls-config(1)

NAME
libgnutls-config - helper script for building with libgnutls SYNOPSIS
libgnutls-config [--version] [--prefix=dir] [--cflags] [--libs] [--exec-prefix=dir] DESCRIPTION
The libgnutls-config tool is used to determine the compiler and linker flags that should be used to compile and link programs that use the libgnutls library. OPTIONS
The following options are supported: --cflags Print the compiler flags that are necessary to compile a program using the specified library. --exec-prefix=dir If specified, use dir instead of the exec installation prefix that the library was built with, when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. --libs Print the linker flags that are necessary to link with the specified library. --prefix=dir If specified, use dir instead of the installation prefix that the library was built with, when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. This option is also used for the exec prefix if the --exec-prefix option is not specified. --version Print the currently installed version of the library on the standard output. EXAMPLES
Example 1: Getting the libgnutls library version example% libgnutls-config --version Example 2: Determining the libraries required to link with the libgnutls library example% libgnutls-config --libs EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/libgnutls-config Executable for libgnutls helper script ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnutls-devel | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
pkg-config(1), libgnutls(3), libgnutlsxx(3), attributes(5) Written by Jeff Cai, Sun Microsystems Inc., 2008. SunOS 5.11 10 Jan 2008 libgnutls-config(1)
All times are GMT -4. The time now is 12:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy