echo "========= CHECKING Current Allocated Workspaces ========="
echo ""
echo "Allocated:"
grep $1 /etc/auto.indirect
echo ""
echo "Windows Friendly Path:"
IFS=/ read -a frags < <(grep $1 /etc/auto.indirect) #set path components into array frags
frags[0]="${frags[0]%:}" #strip ":" off *-filer-ns
echo "$(IFS=\\ ;printf '\\\\%s' "${frags[*]}" ;)" #set IFS to \ to print frags \-separated
The following I have managed to format to :
========= CHECKING Current Allocated Workspaces =========
Allocated:
wsone-rtp -rw,hard,intr,quota filer-filer-ns:/workspace/wslocal010/user
Windows Friendly Path:
\\\wsone-rtp -rw,hard,intr,quota filer-filer-ns\workspace\wslocal010\user
I am trying to find a way to remove the trailing information that comes from the table that I am calling.
What i wish to remove from anything called:
wsone-rtp -rw,hard,intr,quota
keeping in mind that the first entry of the wsone-rtp changes depending on the earlier user call from the table. For example user A could be : wsone-rtp -rw,hard,intr,quota For example user B could be : wstwo-rtp -rw,hard,intr,quota
I'm thinking there must be some way to remove x number of characters from the beginning of the called string?
Ideal final output would to convert :
wsone-rtp -rw,hard,intr,quota filer-filer-ns:/workspace/wslocal010/user
to
\\filer-filer-ns\workspace\wslocal010\user