Sponsored Content
Top Forums Shell Programming and Scripting How to create a simple copy script? Post 302560253 by jayan_jay on Thursday 29th of September 2011 09:40:45 AM
Old 09-29-2011
put that 4 lines in a file named "infile"
Code:
$ cat infile
/var/router/system1/config/backup/install.put
/var/router/system2/config/backup/install.put
/var/router/system3/config/backup/install.put
/var/router/system4/config/backup/install.put

Then run the code which i have given ..
Code:
$ awk -F. '{print "cp "$0" "$1".dat"}' infile | sh

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Modifying simple commands to create a script

Can anyone direct me to a resource that explains scripting in simple terms? I have visited many sites and browsed this forum and have yet to find simple explanations. (8 Replies)
Discussion started by: rocinante
8 Replies

2. Shell Programming and Scripting

Create A Simple GUI For Shell Script

Hi all! Im wondering if its possible to create a GUI for a shell script I just got done writing as the people that will be using it dont like the command line all to well. Just something simple with radio buttons to select options, maybe a text field to enter a location to save the file generated... (1 Reply)
Discussion started by: Grizzly
1 Replies

3. Shell Programming and Scripting

Simple Script to create folders

Hi I want to write a small script that will create folders named from `AAAA' all the way to `ZZZZ'. That is: `AAAA' `AAAB' `AAAC' ... `AABA' `AABB' `AABC' ... `ABAA' `ABAB' `ABAC' ... `ABBA' ... `ZZZZ' (4 Replies)
Discussion started by: ksk
4 Replies

4. Solaris

How to create a simple background script on Solaris

I have a local account for a unix server. The idle timeout for the account is around 10 mins. I have to login to the server multiple times during the day. Is there a way to increase the idle timeout or may be a script that I can run on background so it is not idle. Something like echo date every 9... (3 Replies)
Discussion started by: vinaysa
3 Replies

5. Shell Programming and Scripting

How to create a simple shell script to backup

Hello - I am in process of deleting many files which are older than 4 weeks. For example I am inside: /subsystem/prod/ Files are with various extentions, but anything older than 4 weeks should be deleted. What would be the most simplest script to acheive this? (4 Replies)
Discussion started by: DallasT
4 Replies

6. Shell Programming and Scripting

Need to create a simple script using MD5, SSH...

Hi all, I am brand new to these forums and I am a brand new UNIX Administartor. Don't know any scripting yet :wall:, and would like to learn as my boss is slowly letting me understand everything about being a Sys/*Nix Admin. He created this script which I am trying to replicate because I lost it... (54 Replies)
Discussion started by: zixzix01
54 Replies

7. Shell Programming and Scripting

Create simple script

Dear all, I have a directory named A and some subdirectories named B, C, D with .xml files. I want to use the following command to strip the file. sed -re ':start s/<*>//g; /</ {N; b start}' file.xml > file.xml At the same time, I want to remove the blank lines using sed '/^$/d' How can... (6 Replies)
Discussion started by: corfuitl
6 Replies

8. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

9. UNIX and Linux Applications

Really simple shell script to create oracle database

Hello , I am new in this forum and need your help as I am totally confused :confused: I read a lot of threads and tried to search a lot but did not get the exact answer to my question. I just want a simple (content wise may be long) shell script to create oracle database. In detail:... (5 Replies)
Discussion started by: rahoolm
5 Replies

10. Homework & Coursework Questions

Create a simple bash backup script of a file

This is the problem: Write a script that will make a backup of a file giving it a ‘.bak’ extension & verify that it works. I have tried a number of different scripts that haven't worked and I haven't seen anything really concise and to the point via google. For brevity's sake this is one of the... (4 Replies)
Discussion started by: demet8
4 Replies
uucp(1) 						      General Commands Manual							   uucp(1)

NAME
uucp - Unix to Unix copy SYNOPSIS
uucp [ options ] source-file destination-file uucp [ options ] source-file... destination-directory DESCRIPTION
The uucp command copies files between systems. Each file argument is either a pathname on the local machine or is of the form system!path which is interpreted as being on a remote system. In the first form, the contents of the first file are copied to the second. In the sec- ond form, each source file is copied into the destination directory. A file be transferred to or from system2 via system1 by using system1!system2!path. Any pathname that does not begin with / or ~ will be appended to the current directory (unless the -W or --noexpand option is used); this resulting path will not necessarily exist on a remote system. A pathname beginning with a simple ~ starts at the UUCP public directory; a pathname beginning with ~name starts at the home directory of the named user. The ~ is interpreted on the appropriate system. Note that some shells will interpret a simple ~ to the local home directory before uucp sees it; to avoid this the ~ must be quoted. Shell metacharacters ? * [ ] are interpreted on the appropriate system, assuming they are quoted to prevent the shell from interpreting them first. The copy does not take place immediately, but is queued up for the uucico (8) daemon; the daemon is started immediately unless the -r or --nouucico switch is given. In any case, the next time the remote system is called the file(s) will be copied. OPTIONS
The following options may be given to uucp. -c, --nocopy Do not copy local source files to the spool directory. If they are removed before being processed by the uucico (8) daemon, the copy will fail. The files must be readable by the uucico (8) daemon, and by the invoking user. -C, --copy Copy local source files to the spool directory. This is the default. -d, --directories Create all necessary directories when doing the copy. This is the default. -f, --nodirectories If any necessary directories do not exist for the destination path, abort the copy. -R, --recursive If any of the source file names are directories, copy their contents recursively to the destination (which must itself be a direc- tory). -g grade, --grade grade Set the grade of the file transfer command. Jobs of a higher grade are executed first. Grades run 0 ... 9 A ... Z a ... z from high to low. -m, --mail Report completion or failure of the file transfer by mail (1). -n user, --notify user Report completion or failure of the file transfer by mail (1) to the named user on the remote system. -r, --nouucico Do not start uucico (8) daemon immediately; merely queue up the file transfer for later execution. -j, --jobid Print jobid on standard output. The job may be later cancelled by passing the jobid to the -k switch of uustat (1). It is possible for some complex operations to produce more than one jobid, in which case each will be printed on a separate line. For example uucp sys1!~user1/file1 sys2!~user2/file2 ~user3 will generate two separate jobs, one for the system sys1 and one for the system sys2. -W, --noexpand Do not prepend remote relative path names with the current directory. -t, --uuto This option is used by the uuto shell script. It causes uucp to interpret the final argument as system!user. The file(s) are sent to ~/receive/USER/LOCAL on the remote system, where USER is from the final argument and LOCAL is the local UUCP system name. Also, uucp will act as though --notify user were specified. -x type, --debug type Turn on particular debugging types. The following types are recognized: abnormal, chat, handshake, uucp-proto, proto, port, config, spooldir, execute, incoming, outgoing. Only abnormal, config, spooldir and execute are meaningful for uucp. Multiple types may be given, separated by commas, and the --debug option may appear multiple times. A number may also be given, which will turn on that many types from the foregoing list; for example, --debug 2 is equivalent to --debug abnormal,chat. -I file, --config file Set configuration file to use. This option may not be available, depending upon how uucp was compiled. -v, --version Report version information and exit. --help Print a help message and exit. SEE ALSO
mail(1), uux(1), uustat(1), uucico(8) BUGS
Some of the options are dependent on the capabilities of the uucico (8) daemon on the remote system. The -n and -m switches do not work when transferring a file from one remote system to another. File modes are not preserved, except for the execute bit. The resulting file is owned by the uucp user. AUTHOR
Ian Lance Taylor <ian@airs.com> Taylor UUCP 1.07 uucp(1)
All times are GMT -4. The time now is 04:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy