Use only ln, display error messages in stderr
This commit is contained in:
parent
3f8dc335a0
commit
d4d3289216
1 changed files with 6 additions and 8 deletions
|
@ -40,13 +40,13 @@ fi
|
|||
STATE="$STATE1$STATE2"
|
||||
case $STATE in
|
||||
[89]* )
|
||||
echo "$F1 is not a proper file (or a non-existent one)"
|
||||
echo "Note that only regular files and directories are allowed"
|
||||
>&2 echo "$F1 is not a proper file (or a non-existent one)"
|
||||
>&2 echo "Note that only regular files and directories are allowed"
|
||||
exit $STATE
|
||||
;;
|
||||
*[89] )
|
||||
echo "$F2 can not be created (containing directory does not exist)"
|
||||
echo "or exists already (refusing to overwrite)"
|
||||
>&2 echo "$F2 can not be created (containing directory does not exist)"
|
||||
>&2 echo "or exists already (refusing to overwrite)"
|
||||
exit $STATE
|
||||
;;
|
||||
[01]0 ) # file or dir to an existing dir
|
||||
|
@ -68,7 +68,5 @@ esac
|
|||
#echo $DEGUB
|
||||
|
||||
# Step 4: eventually act upon gathered knowledge ###############################
|
||||
mv $PATH1 $PATH2
|
||||
cd $(dirname $PATH1)
|
||||
ln -s $PATH2 $(basename $PATH1)
|
||||
|
||||
ln $PATH1 $PATH2 # Hard link to new location (fast!)
|
||||
ln -sf $PATH2 $PATH1 # Soft link back to old location
|
||||
|
|
Loading…
Reference in a new issue