Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now
3 added 234 characters in body
source | link

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows

echo "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:"
ypmatchecho "\\\\`ypmatch $EndUser auto_home | awk -F':' '{print $1}'`\\$EndUser"

gives me the print out of :


The home directory is located here:
rtp1-filer-ns:/homedir-private/private007/user

Windows path to home directory:
\\rtp1-filer-ns\user

assuming i can use sed /awk something of the sorts , open for suggestions $EndUser is a defined var

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows

echo "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:"
ypmatch $EndUser auto_home | 

assuming i can use sed /awk something of the sorts , open for suggestions $EndUser is a defined var

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows

echo "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}'`\\$EndUser"

gives me the print out of :


The home directory is located here:
rtp1-filer-ns:/homedir-private/private007/user

Windows path to home directory:
\\rtp1-filer-ns\user

assuming i can use sed /awk something of the sorts , open for suggestions $EndUser is a defined var

2 deleted 157 characters in body
source | link

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows

echo "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:" ypmatch $EndUser auto_home |


echo "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:"
ypmatch $EndUser auto_home | 

assuming i can use sed awk/awk something of the sorts , open for suggestions $EndUser is a defined var

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows

echo "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:" ypmatch $EndUser auto_home |

assuming i can use sed awk/ something of the sorts , open for suggestions $EndUser is a defined var

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows


echo "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:"
ypmatch $EndUser auto_home | 

assuming i can use sed /awk something of the sorts , open for suggestions $EndUser is a defined var

1
source | link

reformatting command output within bash script

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/user

and would like to reformat as for my users ease Windows path to home directory: \rtp1-filer-ns\homedir-private\private007\user

currently this part of the script is as follows

echo "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:" ypmatch $EndUser auto_home |

assuming i can use sed awk/ something of the sorts , open for suggestions $EndUser is a defined var