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

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-f] [-q] [-t] [file] DESCRIPTION
Script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. Options: -a Append the output to file or typescript, retaining the prior contents. -f Flush output after each write. This is nice for telecooperation: One person does `mkfifo foo; script -f foo' and another can super- vise real-time what is being done using `cat foo'. -q Be quiet. -t Output timeing data to standard error. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays. The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. Script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism), replay(1). HISTORY
The script command appeared in 3.0BSD. BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. Linux July 30, 2000 Linux
All times are GMT -4. The time now is 09:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy