Difference between
modified post 80a634c by Anonymous on Fri 10th Feb 2023 11:05
original post d39479 by Anonymous on Wed 8th Feb 2023 14:54
Download diff
Show
old version |
new version |
both versions
| 1 | 1 | #!/usr/bin/ksh93 | |
| 2 | 2 | # | |
| 3 | 3 | # sshnfs - remote login client with NFSv4 forwarding | |
| 4 | 4 | # | |
| 5 | 5 | # Example usage: | |
| 6 | - | # $ ksh sshnfs.ksh nfs://localhost/export/home/rmainz root@10.49.20.207 # | |
| 6 | + | # $ ksh sshnfs.ksh -o NFSURL=nfs://localhost/export/home/rmainz root@10.49.20.207 # | |
| 7 | + | # $ ksh sshnfs.ksh -o NFSURL=nfs://localhost/export/home/rmainz -o NFSJumphost=derfwpc5131 root@10.49.20.207 | |
| 7 | 8 | # | |
| 8 | 9 | # Written by Roland Mainz <roland.mainz@nrubsig.org> | |
| 9 | 10 | # | |
| 10 | 11 | ||
| 11 | 12 | # | |
| 12 | 13 | # parse url | |
| 13 | 14 | # | |
| 14 | 15 | # returns: | |
| 15 | 16 | # data.protocol | |
| 16 | 17 | # data.host | |
| 17 | 18 | # data.port (optional) | |
| 18 | 19 | # data.path | |
| 19 | 20 | # | |
| 20 | 21 | function parse_url | |
| 21 | 22 | { | |
| 22 | 23 | typeset url="$2" | |
| 23 | 24 | typeset leftover | |
| 24 | 25 | nameref data="$1" | |
| 25 | 26 | ||
| 27 | + | # ~(E) is POSIX extended regular expression matching (instead of | |
| 26 | 29 | leftover="${url//~(Elr)(.+?):\/\/(.+?)(?:|:([[:digit:]]+))(?:\/(.*?))?/x}" | |
| 27 | 30 | ||
| 31 | + | # All parsed data should be captured via eregex in .sh.match - if | |
| 28 | 34 | [[ "$leftover" == 'x' ]] || { print -u2 -f $"%s: Parser error\n" "$0" ; return 1 ; } | |
| 29 | 35 | ||
| 36 | + | data.protocol="${.sh.match[1]}" |
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.
rovema.kpaste.net RSS