Hacker News new | ask | show | jobs
by pwg 4172 days ago
Assuming the shell script is for Bash, that incantation removes the shortest matching suffix which matches the pattern "/*". So it is attempting to remove the filename component from a pathname string in the "0" positional parameter.

Since $0 is usually the name of the shellscript itself, this would be trying to obtain the directory path of the shellscript.