11-23-2007
copy similar files only both at different locations using script.
Hello,
Here is the situation..............
[root@server 123]# pwd
/opt/123
[root@server 123]# cat index.txt
abc-monitor/homedir/public_html/index.php
abc-monitor/homedir/public_html/test/index.php
abc-monitor/homedir/public_html/test1/index.php
[root@server 123]# cp index.txt index.home
[root@server123]# cat /root/x
#!/bin/bash
user="monitor"
replace "cpmove-$user/homedir" "/$user" -- index.home
[root@server 123]# chmod +x /root/x ; /root/x
[root@server 123]# cat index.home
/home/monitor/public_html/index.php
/home/monitor/public_html/test/index.php
/home/monitor/public_html/test1/index.php
Now I want such a script that all files in `cat index.txt` will move to `cat index.home` and replace them.
Example...
mv -f abc-monitor/homedir/public_html/index.php /home/monitor/public_html/index.php
mv -f abc-monitor/homedir/public_html/test/index.php /home/monitor/public_html/test/index.php
mv -f abc-monitor/homedir/public_html/test1/index.php /home/monitor/public_html/test1/index.php
Please advise.
Thanks
Last edited by fed.linuxgossip; 11-23-2007 at 01:18 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure,
say location 1,
/home/rick/tmp_files/1-12/00-25/
here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Discussion started by: pharos467
1 Replies
2. Shell Programming and Scripting
Hi all,
My tar file exists in directory: /usr/users/rovolis/test1/archive.tar
Now from directory: /usr/users/rovolis/ i run the following command
tar xvzf /usr/users/rovolis/test1/archive.tar
The problem is that the extraction of files is not done
Any idea why?
Thank you (1 Reply)
Discussion started by: chriss_58
1 Replies
3. Shell Programming and Scripting
Hi everybody,
I need a script for below issue:
I have totally 15 different locations like */COUNTRY/in.
Only COUNTRy is the variable which changes for 15 countries.
For each location(one per country), there will be four files like abc_def_ddmmyyyy.txt, where ddmmyyyy is the old date.
... (1 Reply)
Discussion started by: rjanardhan83
1 Replies
4. UNIX for Dummies Questions & Answers
Hey guys I have written a bash script that compares two directories and displays the files that are different in the directories. Now my problem is the script only runs in my home directory. What do I have to do so it will run in other directories.
Thanks if anyone can help.
Duplicate post.... (0 Replies)
Discussion started by: Joey12
0 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am just wondering is it possible to move or copy a file from a UNIX server to a different location e.g. the C drive on a computer?
I have used the cp command to move files to different locations on unix servers but it would be handy to move a file to my C drive.
I am currently... (3 Replies)
Discussion started by: crunchie
3 Replies
6. Shell Programming and Scripting
I have in directory /media/AUDIO/WAVE many .mp3 files with names like:
my filename_01of02.mp3
my filename_02of02.mp3
Your File_01of06.mp3
Your File_02of06.mp3
etc....
In the same directory, /media/AUDIO/WAVE, I have many folders with names like
9780743579490
9780743579491
etc..
Inside... (7 Replies)
Discussion started by: glev2005
7 Replies
7. Shell Programming and Scripting
Thanks Bartus11 for your help in the following code to compare the two files "t1" and "t2".
awk 'NR==FNR{a=1;next}$2 in a{print $2}' t1 t2
First can anyone explain that what is the purpose of assigning a =1?
Second, the current script is printing out the matched columns between the... (4 Replies)
Discussion started by: coder83
4 Replies
8. Shell Programming and Scripting
Hi,
I am new to awk/unix and am trying to put together an awk script to perform an action similar to vlookup between the two csv files.
Here are the contents of the two files:
File 1:
Date,ParentID,Number,Area,Volume,Dimensions
2014-01-01,ABC,247,83430.33,857.84,8110.76... (9 Replies)
Discussion started by: Prit Siv
9 Replies
9. Shell Programming and Scripting
Hi,
I need help in regard to developing a shell script to delete empty files from multiple specific locations. The directory paths will be stored in a text file. So the requirement is to read the text file for one specific path and then remove empty files from that particular path. Looping through... (4 Replies)
Discussion started by: Khan28
4 Replies
10. Shell Programming and Scripting
Hello Team .
I am working a health check script ( bash) to run on linux server ( RedHat) and requirements are
1. The o/p of script need to be send to two diff files . I am testing with tee command . But I am not successful yet , any recommendations if that is the right approach ?
2. The same... (2 Replies)
Discussion started by: Varja
2 Replies
LEARN ABOUT PHP
resourcebundle_get
RESOURCEBUNDLE_GET(3) 1 RESOURCEBUNDLE_GET(3)
ResourceBundle::get - Get data from the bundle
Object oriented style
SYNOPSIS
public mixed ResourceBundle::get (string|int $index)
DESCRIPTION
Procedural style
mixed resourcebundle_get (ResourceBundle $r, string|int $index)
Get the data from the bundle by index or string key.
PARAMETERS
o $r
-ResourceBundle object.
o $index
- Data index, must be string or integer.
RETURN VALUES
Returns the data located at the index or NULL on error. Strings, integers and binary data strings are returned as corresponding PHP types,
integer array is returned as PHP array. Complex types are returned as ResourceBundle object.
EXAMPLES
Example #1
resourcebundle_get(3) example
<?php
$r = resourcebundle_create( 'es', "/usr/share/data/myapp");
echo resourcebundle_get($r, 'somestring');
?>
Example #2
OO example
<?php
$r = new ResourceBundle( 'es', "/usr/share/data/myapp");
echo $r->get('somestring');
?>
The above example will output:
?Hola, mundo!
SEE ALSO
resourcebundle_count(3).
PHP Documentation Group RESOURCEBUNDLE_GET(3)