How to cut the last field in this shell string
LINE=\"/string/to/cut.txt\"
So that the string would look like this
LINE=\"/
This will work in modern Bourne versions such as Dash, BusyBox ash, etc., as well as descendents such as Bash, Korn shell and Z shell.
LINE="/string/to/cut.txt" LINE=${LINE%/*}
or to keep the final slash:
LINE=${LINE%/*}/