Sponsored Content
Top Forums Shell Programming and Scripting Copy an array to a newly created directory Post 302788653 by Skrynesaver on Tuesday 2nd of April 2013 09:11:32 AM
Old 04-02-2013
try the following:
Code:
#!/usr/bin/perl

use strict;     #These two lines will
use warnings; # save you hours of debugging time
use File::Copy;
use File::Basename;

my $my_file = "makefile";
open(my $makefile,'<', "$my_file");


while(<$makefile>)
{
	if(/check_geomtools.exe: (.*./\.lib)$/){
          my $full_path=$1;
          chomp($full_path);
          my $filename = basename($full_path);
          mkdir "Scratch" if ( ! -d Scratch) ;
	  copy($full_path, "Scratch/$filename");
	}
}

 

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
scratch(1)						      General Commands Manual							scratch(1)

NAME
Scratch - An easy to use interactive programming environment for ages 8 and up. Description Scratch is an easy, interactive, collaborative programming environment designed for creation of interactive stories, animations, games, music, and art -- and sharing these on the web. Scratch is designed to help young people (ages 8 and up) develop 21st century learning skills. As they create Scratch projects, young people learn important mathematical and computational ideas, while also gaining a deeper understanding of the process of design. This man page contains basic information about Scratch. For additional information, see the Scratch website at http://scratch.mit.edu. OPTIONS
Options are set through the .scratch.ini file in the user's home directory. For instructions on how to edit this file, see http://info.scratch.mit.edu/Network_Installation. BUGS
Please report bugs to the package maintainer. For the most recent version of this package, see http://info.scratch.mit.edu/Linux_installer FILES
/usr/bin/scratch - scratch startup script /usr/lib/scratch/ - Contains Scratch.image (Squeak image containing Scratch code), and scratch.ini file /usr/share/scratch/- Contains subdirectories with Scratch media library, sample projects, and language files. COPYRIGHT
Scratch is Copyright (C) 2011 Massachusetts Institute of Technology and released under the GPL v2. See the LICENSE file included with the source code. The Scratch logo, the Scratch cat, and Gobo are trademarks of MIT and may not be used in substantially modified programs based on the Scratch source code. Scratch is developed by the Lifelong Kindergarten group at the MIT Media Lab. See http://scratch.mit.edu scratch(1)
All times are GMT -4. The time now is 11:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy