Hello,
I have a doubt:-
---------------------
Current script:-
################################################################################################
prefix=user@my-server:
find . -depth -type d -name .git -printf '%h\0' | while read -d "" path ; do (
cd "$path" || exit $?
name="`basename "$path"`"
echo <command> "$prefix$PWD.git"
) done
#################################################################################################
Output:-
<command>
user@my-server:/home/git/mirror/android/adb/OpenWnn.git
<command>
user@my-server:/home/git/mirror/android/adb/cts.git
<command>
user@my-server:/home/git/mirror/android/adb/dalvik.git
<command>
user@my-server:/home/git/mirror/android/adb/ndk.git
#################################################################################################
Desired output:-
<command>
user@my-server:/android/adb/OpenWnn.git
<command>
user@my-server:/mirror/android/adb/cts.git
<command>
user@my-server:/android/adb/dalvik.git
<command>
user@my-server:/mirror/android/adb/ndk.git
##################################################################################################
How shall i go about changing the absolute path to relative path, so that /home/git/mirror/android/adb/ndk.git
gets converted to /mirror/android/adb/ndk.git
//echo <command> "$prefix$PWD.git" ?? - anything for relative path??
##################################################################################################