Quote:
I already solved that: http://www.linuxquestions.org/questi...4/#post4357066 |
Hi,
Yes, I've noticed that but that wouldn't work if it were the first run. Say OP is running his tests in a testing environment to build a solution for his problem. After the first run .dir gets added, on the second run and the ones thereafter, if he does change the command between runs, he will not get .dir.dir and so on. But what if he wants to run this as a one command solution on another machine? Most likely OP just runs your commands to clean up his system so this doesn't apply but just thought it worth mentioning for completeness. Kind regards, Eric |
Quote:
|
Hi,
Sorry, didn't notice you've added the -not option. My brain is on Sunday mode. Should work correctly. Kind regards, Eric |
Hello Guys,
Came across another scenario, i'm struck at a point, Need your inputs to proceed further:- ------ 1. Traverse entire file system, look for directories which has .git directory in it 2. Rename the immediate parent directory to <orignal_name.git> 3. Traverse this new file structure and look for all directories with <original_name>.git 4. cd to that directory and remove its contents 5. once everything inside the directory is deleted, create a file ------ Code:- Step 1:- find * -type d -iname '.git' Step 2:- function rename_git_parent { for file in "$1"/* do cd .. | $(pwd) -exec mv '{}' '{}'.git ';' done return 1 } //i am not too sure if its the right way of doing it, or shall i use dirname... How shall i go about step2 and ownwards... Appreciate the help. Thanks. Regards Sahil |
All times are GMT -5. The time now is 10:27 PM. |