Loading...
Engaged Employer
what is relative path? write a program to convert relative path to absolute path.
Anonymous
#!/bin/sh myPath='/usr/./local/../../bin/./../var/./log/' cd $myPath newPath=`pwd` echo $newPath
and add the relative paths as an argument to the script myPath=$1
readlink doesn't accept any parameter "-m"
readlink -m "relative path" Example., readlink -m .. Will give the absolute path of the parent directory
convert /usr/./local/../../bin/./../var/./log/ the absolute path for this is /var/log/ I had been asked to write a shell script to find it.
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalized job recommendations and updates by starting your searches.