Hello,
I have a script written the unix shell language (NOT in bash or any other shell, in sh) that prints the mount point of a given usb (i.e, it takes the path of a usb (such as /dev/sdb1) as an argument). Here it is:
#!/bin/sh
# usage: get_mount [path]
# returns: mount pount of given usb path
pth=$1
echo $pth
mountPoint="`df -h | grep $pth | tr -s \" \"| cut \"-d \" -f6`"
echo $mountPoint
The problem is, when I run this, it just prints a blank string, and I know the command works because I've tried it in a terminal with no problem: it's just assigning it to a variable is what's not working. Anyone have any ideas? Thx in advance!