Sponsored Content
Top Forums Shell Programming and Scripting Match File and Copy File Script (Homework, Closed) Post 302358666 by thegeek on Sunday 4th of October 2009 12:58:19 AM
Old 10-04-2009
Code:
file=/tmp/t1

while read files
do
    if [ -f $files ];then
        echo $files
        # do the copy operation here
    fi    
done < $file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

please help (closed homework thread)

I have these questions for my unix class that I can't figure out because I missed a couple of days. They are for a quiz we took last week so by answering the questions you are not bettering my grade or doing my homework. I just want to understand was the answers. My teacher is really bad at... (1 Reply)
Discussion started by: djeung
1 Replies

2. UNIX for Dummies Questions & Answers

file activity (open/closed) file descriptor info using KORN shell scripting

I am trying to find a way to check the current status of a file. Such as some cron job processes are dependent on the completion of others. if a file is currently being accessed / modified or simply open state I will wait until it is done being processed before attempting the next process on that... (3 Replies)
Discussion started by: Gary Dunn
3 Replies

3. Shell Programming and Scripting

Script to capture new lines in a file and copy it to new file

Hi All, I have a file that gives me new line/output every 5 minutes. I need to create a script that capture new line/output besides "IN CRON_STATUS", in this case the new output is "begin ------ cron_status.sh - -----------". I want this script to capture the line starting from "begin ------... (0 Replies)
Discussion started by: fara_aris
0 Replies

4. Shell Programming and Scripting

copy file from script file to remote computer

hi, i want copy one or group of file from a computer to others, but i have some problem that do not allow me to do this. i do this by scp command like this : scp <file name> root@cpName:destinationAddress but the problem is that it do not it automatically. it means when it is connecting to... (4 Replies)
Discussion started by: MShirzadi
4 Replies

5. UNIX for Dummies Questions & Answers

Shell script to search for text in a file and copy file

Compete noob question.... I need a script to search through a directory and find files containing text string abcde1234 for example and then copy that file with that text string to another directory help please :eek: (9 Replies)
Discussion started by: imeadows
9 Replies

6. UNIX for Dummies Questions & Answers

3 homework questions (thread closed)

1st) how can i print only directories? 2nd) how can i print files that someone used in the last X days (for example, 5). thanks very much, i need it for homework and teacher teachs us nothing:( (1 Reply)
Discussion started by: SupErioR
1 Replies

7. Shell Programming and Scripting

Linux unix help (homework, closed)

i have to do this but i am confused, Create a file containing the bash functions which perform the following tasks. Clearly label each function. Print out and turn in this file. 1.Write a function which displays the current date, time, username, and current directory. ... (1 Reply)
Discussion started by: CRAZYLITTLELOU
1 Replies

8. Solaris

Adding user with restrictions (Closed Homework)

Hello, I would to create a new user with some restriction: Example "Toto" I am a newer in unix please tell me how to do 1. The user will will have only remote access via FTP ( not telnet, ssh etc ...) 2. The user will not be able to access via FTP to other directory 4) He will access only... (1 Reply)
Discussion started by: fedeboubou
1 Replies

9. UNIX for Dummies Questions & Answers

Script to copy file small interval file

HI Guys whenever i post a transaction , abcd.in file is stored in the temp and vanishes when the transaction is compleated . the abcd.in file stays for 1 sec in temp is der any solution to capture the abcd.in file to another directory cp -r /tmp/abcd.in /tmp/smith.in when i used the... (1 Reply)
Discussion started by: kalyankalyan
1 Replies

10. Shell Programming and Scripting

Need Help - match file name and copy to Directory

I am trying to sort the following files from folder Bag to Apple, Cat Food, Dog Food. I can get all of the files I want into a new folder, but not sure of the best approch to get them to their final directory My Files ========== apple.1234.ext apple.1235.ext cat food 101.ext Cat Food... (2 Replies)
Discussion started by: mtschroeder
2 Replies
File::Copy::Link(3pm)					User Contributed Perl Documentation				     File::Copy::Link(3pm)

NAME
File::Copy::Link - Perl extension for replacing a link by a copy of the linked file. SYNOPSIS
use File::Copy::Link; copylink 'file.lnk'; use File::Copy::Link qw(safecopylink); safecopylink 'file.lnk'; DESCRIPTION
"copylink" reads the filename linked to by the argument and replaced the link with a copy of the file. It opens a filehandle to read from the link, deletes the link, and then copies the filehandle back to the link. "safecopylink" does the same as "copylink" but without the open-and-delete manouvre. Instead, it uses "File::Spec::Link" to find the target of the link and copies from there. This module is mostly a wrapper round "File::Spec::Link::linked" and "File::Copy::copy", the functionality is available in a command line script copylink. EXPORT Nothing by default, can export "copylink", `"safecopylink". SEE ALSO
copylink(1) File::Copy(3) File::Spec::Link(3) AUTHOR
Robin Barker, <Robin.Barker@npl.co.uk> COPYRIGHT AND LICENSE
Copyright 2003, 2006, 2007 by Robin Barker This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.12.4 2011-09-30 File::Copy::Link(3pm)
All times are GMT -4. The time now is 03:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy