Plan 9 from Bell Labs’s /usr/web/sources/patch/applied/ape-script-tweeks/ln

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc

argv0=$0
force=n
while(! ~ $#* 0 && ~ $1 -*){
	switch($1){
	case -f
		force=y
	case -s
		;
	case *
		echo 'usage: ln [-s] [-f] source destination' >[2=1]
		exit 'usage'
	}
	shift
}


if(~ $force n && test -e $2 && ! test -d $2){
	echo ln: $2 destination exists >[2=1]
	exit 'usage'
}

exec cp -gux $1 $2

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.