23 lines
298 B
Bash
Executable file
23 lines
298 B
Bash
Executable file
#!/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' >[1=2]
|
|
exit 'usage'
|
|
}
|
|
shift
|
|
}
|
|
|
|
if(~ $force n && test -e $2){
|
|
echo ln: $2 destination exists >[1=2]
|
|
exit 'usage'
|
|
}
|
|
|
|
exec cp -gux $1 $2
|