To quote from here: https://unix.stackexchange.com/questions/243972/pmount-hangs-on-bash-autocomplete

The problem with the reference file arises in the function |_pmount()| at line 62 of the file (added newlines for readability - not in original file):

|devices="$( command ls $(grep -v '^[[:space:]]*#' /etc/pmount.allow )\ $(grep 1 /sys/block/*/removable |\ sed -e 's,/sys/block/,/dev/,;s,/removable:1,*,') 2>/dev/null |\ sort -u | sed -e 's,\(^/dev/\)\(.*\),\1\2 \2,' ; \ #this last line is of interest, as the errors occur here grep $mdir /proc/mounts | sed -e 's,.*\($mdir/[^ ]*\).*,\1,' )"|

with the error being that for

|grep $mdir /proc/mounts|

the variable |$mdir| is not defined previously and thus the script hangs.

So I added the definition of |mdir|

|mdir="$(readlink -f /media)"|
as taken from the |_pumount()| function of the same script (see line 75) at e.g. line 36 as |mdir| seems to be standing for *m*edia (or *m*ount) *dir*ectory, i.e. the standard mount point for |pmount|.

Please append the fix to the stock reference file.

Reply via email to