pastebin - collaborative debugging tool
rovema.kpaste.net RSS

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

    
11
#!/usr/bin/ksh93
22
#
33
# sshnfs - remote login client with NFSv4 forwarding
44
#
55
# 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
78
#
89
# Written by Roland Mainz <roland.mainz@nrubsig.org>
910
#
1011
1112
#
1213
# parse url
1314
#
1415
# returns:
1516
# data.protocol
1617
# data.host
1718
# data.port (optional)
1819
# data.path
1920
#
2021
function parse_url
2122
{
2223
	typeset url="$2"
2324
	typeset leftover
2425
	nameref data="$1"
2526
27+
	# ~(E) is POSIX extended regular expression matching (instead of
2629
	leftover="${url//~(Elr)(.+?):\/\/(.+?)(?:|:([[:digit:]]+))(?:\/(.*?))?/x}"
2730
31+
	# All parsed data should be captured via eregex in .sh.match - if
2834
	[[ "$leftover" == 'x' ]] || { print -u2 -f $"%s: Parser error\n" "$0" ; return 1 ; }
2935
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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at