com bash
Primeira abordagem - use a substituição de parâmetros
#use command substitution to set command output into variable var
var=$(ypmatch $EndUser auto_home)
#strip out the first :
var=${var/:}
#replace all instances of / with \
var=${var//\//\}
echo $var
rtp1-filer-ns\homedir-private\private007\user
Segunda abordagem - usar matrizes
# Set path components into array frags
IFS=/ read -a frags < <(ypmatch $EndUser auto_home)
# Strip ":" off rtp1-filer-ns
frags[0]="${frags[0]%:}"
# Set IFS to \ to print frags \-separated
echo "$(IFS=\ ;printf '%s\n' "${frags[*]}";)"
rtp1-filer-ns\homedir-private\private007\user