using variables when copying files


 
Thread Tools Search this Thread
Operating Systems OS X (Apple) using variables when copying files
Prev   Next
# 4  
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!!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
Login or Register to Ask a Question
SUPERGLOBALS(3) 							 1							   SUPERGLOBALS(3)

Superglobals - Superglobals are built-in variables that are always available in all scopes

	Several predefined variables in PHP are "superglobals", which means they are available in all scopes throughout a script. There is no need
       to do global $variable; to access them within functions or methods.

	These superglobal variables are:

	      o$GLOBALS

	      o$_SERVER

	      o$_GET

	      o$_POST

	      o$_FILES

	      o$_COOKIE

	      o$_SESSION

	      o$_REQUEST

	      o$_ENV

       +--------+---------------------------------------+
       |Version |					|
       |	|					|
       |	|	       Description		|
       |	|					|
       +--------+---------------------------------------+
       | 4.1.0	|					|
       |	|					|
       |	|  Superglobals were introduced to PHP. |
       |	|					|
       +--------+---------------------------------------+
       Note

	      Variable availability

	       By default, all of the superglobals are available but there are directives that affect this availability. For further  information,
	      refer to the documentation for variables_order.

       Note

	      Dealing with register_globals

	       If the deprecated register_globals directive is set to on then the variables within will also be made available in the global scope
	      of the script. For example, $_POST['foo'] would also exist as $foo.

	       For related information, see the FAQ titled "How does register_globals affect me?"

       Note

	      Variable variables

	       Superglobals cannot be used as variable variables inside functions or class methods.

       variable scope, The variables_order directive, The filter extension.

PHP Documentation Group 													   SUPERGLOBALS(3)