I was wondering if this way of getting the first element from the $PATH
variable is the most optimal and preferred choice on a very large script which needs to be as fast as possible.
echo $PATH | awk -F ":" '{print $1}'
This successfully returns
/usr/local/sbin
- But is there any way of making that line of code faster? Thanks