| | |
copying corresponding language files
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2008
Posts: 1
Reputation:
Solved Threads: 0
Hello fellows,
I'm on Mac OS X and have the following problem:
Using a common cleanup script I got rid of useless localizations, keeping all the english files:
Unfortunately I forgot to also filter out all german files, which would have looked like this:
Since I happen to have a full backup of my system, I would be able to restore all removed german language files to their respective locations...
How could I achieve this??
I would perform the above search for the (still existing) english files...
... which gives me the path for every file, like "/Applications/Foo.app/Contents/Resources/English.lproj"
And then I would need to go to "/Volumes/Backup" + the above path without the filename, look for "de.lproj" and "German.lproj" and copy whatever result to the original location...
Any ideas how this second part of the script would look like? I have no clue and I really don't want to restore hundreds of files manually...
Thanks in advance!
I'm on Mac OS X and have the following problem:
Using a common cleanup script I got rid of useless localizations, keeping all the english files:
Shell Scripting Syntax (Toggle Plain Text)
find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' \) -and \! \( -path '/Library/Receipts/*' -or -path '~/Library/Receipts/*' \) \) -print0 | xargs -0 rm -frv {}
Unfortunately I forgot to also filter out all german files, which would have looked like this:
Shell Scripting Syntax (Toggle Plain Text)
find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' -or -iname 'de*' -or -iname 'ger*' \) -and \! \( -path '/Library/Receipts/*' -or -path '~/Library/Receipts/*' \) \) -print0 | xargs -0 rm -frv {}
Since I happen to have a full backup of my system, I would be able to restore all removed german language files to their respective locations...
How could I achieve this??
I would perform the above search for the (still existing) english files...
Shell Scripting Syntax (Toggle Plain Text)
find /Applications ~/Applications /Library ~/Library \( -iname '*.lproj' -and \! \( -iname 'en*' \) -and \! \( -path '/Library/Receipts/*' -or -path '~/Library/Receipts/*' \) \)
... which gives me the path for every file, like "/Applications/Foo.app/Contents/Resources/English.lproj"
And then I would need to go to "/Volumes/Backup" + the above path without the filename, look for "de.lproj" and "German.lproj" and copy whatever result to the original location...
Any ideas how this second part of the script would look like? I have no clue and I really don't want to restore hundreds of files manually...
Thanks in advance!
•
•
Join Date: Oct 2007
Posts: 399
Reputation:
Solved Threads: 47
What sort of backup did you do (ufsdump, netbackup, etc). You should just be able to restore based on a standard base directory and wildcards, like the find you did to get all the German files.
If you let me know what you're using to backup/restore, I may be able to help you out with a specific course of action.
Best wishes,
Mike
If you let me know what you're using to backup/restore, I may be able to help you out with a specific course of action.
Best wishes,
Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
------------------------------------------------------------------------
The greatest viral marketing idea of all time, get your copy of this Free Report now!
![]() |
Similar Threads
- Multiple COmbo Box (JavaScript / DHTML / AJAX)
- Dual-Boot (Multiboot), 9x-2000, 9x-XP (Windows tips 'n' tweaks)
- Automatic Files Sorting and Folders Creation (VB.NET)
- C++ Books (C++)
- how to install my program (Visual Basic 4 / 5 / 6)
- "Forbidden / You don't have permission to access / on this server." error (Linux Servers and Apache)
- error C2375: 'my_strdup' : redefinition; different linkage (C++)
Other Threads in the Shell Scripting Forum
- Previous Thread: set -x -> putting log into a file other than stderr
- Next Thread: Shell Scripting Problem
Views: 834 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Shell Scripting





