within script the attempt here is to remove the : and then revert the / to \within the print out currently I have to display the linux path: The home directory is located here:rtp1-filer-ns:/homedir-private/private007/userand would like to reformat as for my users ease Windows path to home directory:\rtp1-filer-ns\homedir-private\private007\usercurrently this part of the script is as followsecho The shell is: `ypmatch $EndUser passwd | awk -F\: '{ print $7 }'`echo echo The home directory is located here:   ypmatch $EndUser auto_home echo echo Windows path to home directory:echo \\\\`ypmatch $EndUser auto_home | awk -F':' '{print $1}'`\\$EndUsergives me the print out of : The home directory is located here:rtp1-filer-ns:/homedir-private/private007/userWindows path to home directory:\\rtp1-filer-ns\userassuming i can use sed /awk something of the sorts , open for suggestions$EndUser is a defined var 
reformatting command output within bash script
shell script
With bashFirst approach - use parameter substitution#use command substitution to set command output into variable varvar=$(ypmatch $EndUser auto_home)#strip out the first :var=${var/:}#replace all instances of / with \var=${var//\//\\}echo $varrtp1-filer-ns\homedir-private\private007\userSecond approach - use arrays# Set path components into array fragsIFS=/ read -a frags < <(ypmatch $EndUser auto_home)# Strip : off rtp1-filer-nsfrags[0]=${frags[0]%:}# Set IFS to \ to print frags \-separatedecho $(IFS=\\ ;printf '%s\n' ${frags[*]};)rtp1-filer-ns\homedir-private\private007\user