Sponsored Content
Operating Systems OS X (Apple) using variables when copying files Post 302636653 by hungryd on Monday 7th of May 2012 06:51:31 PM
Old 05-07-2012
three answers in one:

a) didn't know wildcards couldn't be called in quotes.
b) the reminder about my backslash.
c) including the cp into the if statement.

way more elegant now. thank you!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying files

I like to know the command structure of copying files/directories from a unix box using telnet session to a windows box. (4 Replies)
Discussion started by: alpheusm
4 Replies

2. Solaris

Copying Files and

I am new user to solaris and installed solaris operating system on full Harddisk 120Gb. I am unable to copy music files to desktop and /home directory. One thing happened while registering is- i entered login-root and its password. The message prompted your system is crashed. Is it because of... (1 Reply)
Discussion started by: patilmukundraj
1 Replies

3. Shell Programming and Scripting

copying files

hi I want to copy all files from the current directory and move to .archive file. Moreover,I want to add .bak to each file name, that will be copied. How can I do that? (4 Replies)
Discussion started by: tjay83
4 Replies

4. Solaris

Copying Files

Hi, I understand that to copy files across server, the feasible way will be using scp command. Am I right? What if the two servers are not connected to a network? If by using a cross cable to link up both the server, what will be the best (fastest) way to copy files across? scp as well? ... (3 Replies)
Discussion started by: user50210
3 Replies

5. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

6. Shell Programming and Scripting

Copying Files

Hi All, I'm trying to list some files from my log directory and files are like this log.20110302_20.gz log.20110302_21.gz log.20110302_22.gz log.20110302_23.gz log.20110303_00.gz log.20110303_01.gz log.20110303_02.gz ............ log.20110311_22.gz log.20110311_23.gz... (2 Replies)
Discussion started by: thelakbe
2 Replies

7. Shell Programming and Scripting

Help needed in perl; moving or copying the variables

Hi All, I have a perl script blc.pl; i have five variables a,b,c,d and e in this script. Now I want to copy the values of these variables into a data file,say abc.dat.. Can anybody please tell me how to do this? Any help is appreciated.. Thanks in advance (2 Replies)
Discussion started by: puneetkanchi
2 Replies

8. Shell Programming and Scripting

Files copying - [ Listed files alone. ] - Shell script

Hi All, I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files. To Do From Directory : /myproject/MainDir To Directory : /myproject/data List of files need to copy is in the file: /myproject/filesList.txt ... (4 Replies)
Discussion started by: linuxadmin
4 Replies

9. Shell Programming and Scripting

Copying files

All, I need to grab and rename common files from several unique directory structures. For example, the directory structures looks like: /unique_dir/common/common/common/person_name_dir/common_file.txt There are over 90,000 of these text files that I'd like to put in a single directory as... (5 Replies)
Discussion started by: hburnswell
5 Replies

10. Shell Programming and Scripting

Copying files

I'm trying to do this exact same thing, so far I have created this to move files i've named my script CP.sh #!/bin/bash cd /root/my-documents/NewDir/ for f in *.doc do cp -v $f root/my-documents/NewDir $f{%.doc} done When i go to run this in the console i type, bin/sh/ CP.sh but it... (7 Replies)
Discussion started by: MKTM_93_SIMP
7 Replies
packingrules(4) 						   File Formats 						   packingrules(4)

NAME
packingrules - packing rules file for cachefs and filesync SYNOPSIS
$HOME/.packingrules DESCRIPTION
$HOME/.packingrules is a packing rules file for filesync and cachefspack. $HOME/.packingrules contains a list of directories and files that are to be packed and synchronized. It also contains a list of directories and files that are to be specifically excluded from pack- ing and synchronization. See filesync(1) and cachefspack(1M). The $HOME/.packingrules file is automatically created if users invoke filesync with filename arguments. By using filesync options, users can augment the packing rules in $HOME/.packingrules. Many users choose to manually create the packing rules file and edit it by hand. Users can edit $HOME/.packingrules (using any editor) to permanently change the $HOME/.packingrules file, or to gain access to more powerful options that are not available from the command line (such as IGNORE commands). It is much easier to enter complex wildcard expressions by editing the $HOME/.packingrules file. Blank lines and lines that begin with a pound sign (`#') are ignored. Any line can be continued by placing a backslash (`') immediately before the NEWLINE. All other lines in the $HOME/.packingrules file have one of the following formats: PACKINGRULES major. minor. This line is not actually required, but it should be the first line of every packing rules file. This line identifies the packing rules file for the file(1) command and specifies a format version number. The current version number is 1.1. See file(1). BASE directory-1 [directory-2] This line identifies a directory (or pair of directories) under which files should be packed and synchronized. At least one directory name must be specified. For rules that are to be used by filesync a second directory name (where the copies are to be kept) must also be specified. The arguments must be fully qualified path names, and may include environment variables. LIST name ... This line enumerates a list of files and sub-directories (beneath the current BASE) that are to be kept synchronized. This specifica- tion is recursive, in that specifying the name of a directory automatically includes all files and subdirectories it contains. Regular expressions (as described in glob and gmatch) are permitted. See glob(1) and gmatch(3GEN). IGNORE name ... This line enumerates a list of files that are not to be kept synchronized. Regular expressions (using glob and gmatch) are permitted. There are important differences between the arguments to LIST and IGNORE statements. The arguments to a LIST statement can contain slashes and are interpreted as file names relative to the BASE directories. The arguments to an IGNORE statement are simpler names or expressions that cannot contain slashes. An IGNORE statement will not override a LIST statement. IGNORE statements only exclude files that are found beneath LISTed directories. If the first name argument to a LIST statement begins with an exclamation point (`!'), the remainder of the statement will be executed as a command. The command will be run in the current BASE directory. The output of the command will be treated as a list of newline separated file names to be packed/synchronized. The resulting file names will be interpreted relative to the enclosing BASE directory. If the first name argument to an IGNORE statement begins with an exclamation point (`!'), the remainder of the statement will be executed as a command. The command will be run in the current BASE directory. The command will be expected to figure out which names should not be synchronized. The output of the command will be treated as a list of newline separated file names that should be excluded from the packing and synchronization list. Commands will be broken into distinct arguments and run directly with sh -c. Blanks can be embedded in an argument by escaping them with a backslash (`') or enclosing the argument in double quotes (` " '). Double quotes can be passed in arguments by escaping the double quotes with a backslash (`'). LIST lines only apply to the BASE statement that precedes them. IGNORE lines can appear before any BASE statement (in which case they apply to all BASEs) or after a BASE statement (in which case they only apply to the BASE that precedes them). Any number of these statements can occur in any combination. The order is not important. EXAMPLES
Example 1 A sample $HOME.packingrules file. The use of these statements is illustrated in the following $HOME.packingrules file. # # junk files, not worth copying # IGNORE core *.o *.bak *% # # most of the stuff I want to keep in sync is in my $HOME # BASE /net/bigserver/export/home/myname $HOME # everything in my work sub-directory should be maintained LIST work # a few of my favorite mail boxes should be replicated LIST m/incoming LIST m/action LIST m/pending # # I like to carry around a couple of project directories # but skip all the postscript output # BASE /net/bigserver/export/projects $HOME/projects LIST poindexter epiphany IGNORE *.ps # # the foonly package should always be kept on every machine # BASE /net/bigserver/opt/foonly /opt/foonly LIST !cat .packinglist # # and the latest executables for the standard build environment # BASE /net/bigserver/export/buildenv $HOME/buildenv LIST !find . -type f -a -perm -111 -a -print SEE ALSO
file(1), filesync(1), cachefspack(1M) SunOS 5.11 23 Dec 1996 packingrules(4)
All times are GMT -4. The time now is 10:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy