When piped to a text processor like sed then the file name should be in quotes:
Sorry, but this is not the case. "&" is the metacharacter for "everything matched by the regexp in the search part". In this case it is everything matched by ".*", which is the whole line.
The way i wrote it it was single-quoted and hence already protected by the shell. The way you wrote it as a seemingly single-quoted string inside a double-quoted string it is not correct any more because single quotes lose their special meaning inside a quoted string. For instance: echo "this is a ' inside a double-quoted string" will display the single-quote like a normal character whereas echo 'this is a " inside a single-quoted string' will treat the double-quote as normal character and the single-quotes as string delimiters.
The reason is that the shell maintains just one flag "inside quoted string", which is either TRUE or false. Once a (single- or double-) is encountered this flag is switched and only switched back when a second matching (and not escaped) is found. Other quote-chars are ignored (or, respectively, treated as normal characters) during this time.
Having said this it is probably better to rephrase the sed-command this way:
It would be quicker just to get the list of directories and send that to the new server, then loop to do the creations there.
I would also change it to use the -m flag on the mkdir, negating the need for a chmod
You could also use tar if you have a way to exclude files (AIX has the -L flag that may help) to use perhaps fsdump & fsrestore; ufsdump & ufsrestore; or backup & restore
If you use the restore interactively, you can get the structure as is and then abort the actual data restore.
There are probably lots of other options too, like the cpio one above.
Hi,
I am trying to search for a Directory called "mont" under a directory path "/opt/app/var/dumps"
Although "mont" is in the very parent directory called "dumps" i.e "/opt/app/var/dumps/mont" and it can never be inside any Sub-Directory of "dumps"; my below find command which also checks... (5 Replies)
Hi,
Below is my find command
find /opt/app/websphere -name myfolder -perm -600 | wc -l
At time it even takes 20 mins to complete.
my OS is : SunOS mypc 5.10 Generic_150400-09 sun4v sparc SUNW,T5440 (10 Replies)
find /tmp -type f -mtime +180
I have this script get the list to clean up files older than 180 days under /tmp.
But, I want to make sure to grep only a type of files, which have only 6 character long.
....
LT3hqa dRMoya ... (16 Replies)
I was trying to do some experiment with "sed".
I want to find the filenames which are three characters. So, this is what I have done to search for it, using sed.
sed -n -e '/^\{3\}$/p' test
This returns the correct output for characters. But if I make change, let's say i create 2 more... (4 Replies)
Dear All,
OS = Solaris 5.10
Hardware Sun Fire T2000 with 1 Ghz quode core
We have oracle application 11i with 10g database. When ever i am trying to take cold backup of database with 55GB size its taking long time to finish. As the application is down nobody is using the server at all... (8 Replies)
Hi Guys,
I need a help. I have 1130 zip files. Each one of them has files including 1 html file with long file name (includes special charactors, Alphabetic and numbers).
I have copied all 1130 zip files to my linux system and extracted using below command.
Find . -name "*.zip" -exec... (7 Replies)
Hi ,
I am trying to find some files on a remote machine using the find command.
>ssh -q atukuri@remotehostname find /home/atukuri/ -name abc.txt
/home/atukuri/abc.txt
The above command works fine and lists the file, but if I want to do a long listing of files (ls -l) its not working . ... (2 Replies)
The purpose of those comands are to find the newest file in a directory acvrdind to system date, and it has to be recursively found in each directory.
The problem is that i want to list in a long format every found file, but the commands i use produce unexpected results ,so the output lists in a... (5 Replies)
If I have very large text file
***************
***************
***************
***************
***************
ABC-sdfsdf
BBB-xk[ptr';
CCC-sdfolb
ABC-dltg'fl;l
My aim:
-> tail last 10 lines from large text. ***** Ok *****
-> Change first 3 charactors which begin with "ABC" to "abc".... (1 Reply)
Hello,
I create a file touch 1201093003 fichcomp
and inside a repertory (which hava a lot of files) I want to list all files created before this file :
find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long
but i make a filter all... (1 Reply)