1. Find all directories named "ByHost" in a specified directory
2. Rename all .plist files inside "ByHost" directories
This is the way I have been able to do it so far.
When using this method, dotfiles are not included, and there is a file called .GlobalPreferences.UUID.plist in every ByHost folder.
When I try using the find command in the for-loop...
I get this error (I put line breaks in the output to make it readable here in the forum):
If I just echo the $file variable, I get this output, and dotfiles are included (the files outside ByHost directories are included too, which is something I would like to avoid):
When I echo the $file variable in the first script, you can see that it skips dotfiles:
I have tried adding a second for-loop where I specify the path as ./System/Library/User\ Template/*/Library/Preferences/ByHost/.*.plist. It works, but there must be more efficient way.
Any suggestions?
Last edited by Thomas Berglund; 07-13-2008 at 11:02 AM..
I am pretty new to shell scripting. Ordered a few books from Amazon last week (this and this), but they have not been shipped yet. Looking forward to learn more!
Hi,
Friends, i have a requirement where i need to rename my files residing in multiple sub directories and move them to one different directory along with some kind of directory indicator.
For eg:
test--is my parent directory and it has many files such as
a1.txt
a2.txt
a3.txt
... (5 Replies)
HI guys here's hoping some on pout the can help
I have a large library of epub and mobi file creates some what by calibre.
Output of tree listing below
I would like to recursively rename the directories removing the brackets and numbers
I have been scratching my head over... (4 Replies)
Hi all,
I have more than 12000 files in 46 different directories and each directory has 2 sub-directories named “dat” or “gridded”. Dat sub-directories have files with extension “jpg.dat” and gridded sub-directories have files with extension “.jpg”.
I need to... (1 Reply)
I am trying to create a script that will search for a directory named bob, and then rename that directory to peter. I do not want the directory path to change.
so /folders/bob
would become /folders/peter
It seems to be renaming the bob folder to peter correctly, but the peter folder ends... (2 Replies)
Hello
Im trying to make a script in bash shell programming to find subdirectories with the same name into the same directory and rename one of them!!
Could you please help me?
Thanks in advance (1 Reply)
I can rename a file with sequential numbers from 1 to N with this script:
num=1
for file in *.dat;do
mv "$file" "$(printf "%u" $num).txt"
let num=num+1
done
The script begins with renaming a some.dat file to 1.dat.txt and goes on sequentially renaming other DAT files to... (1 Reply)
I have this directory tree under /apps/myapp/data:
imageshack.us/photo/my-images/703/foldersc.png
How to recursively rename ONLY directories with 5 digits (00000, 00100, 00200,..., 00007, 00107,...)?
I want to add to their name two more zeros:
Before: 00107
After: 0000107
Thanks in... (2 Replies)
Hello guys,
I was looking for a shell script that removes all the special characters from the files and the subdirectories recursively. I could not locate it any more. Dose any body have a similar script that dose that?
Thanks for the help.
AV (0 Replies)
hi! i need a command to recursivly search all html files below the current directory for the string "ABCDE". that´s very important to me, thanx!!! (3 Replies)
i have hundreds of directories that have to be renamed. the directory structure is fairly uniform which makes the scripting a little simpler.
suppose i have many directories like this */*/*/*abc* (in other words i have similar directory names 3 dirs deep that all contain the pattern abc in... (8 Replies)