coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ln: make symbolic links default


From: blastmaster
Subject: ln: make symbolic links default
Date: Sat, 1 Apr 2017 01:29:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

>From eb0411a1bb62afc0fff0c8671c0d51a368f5c80f Mon Sep 17 00:00:00 2001
From: blastmaster <address@hidden>
Date: Sat, 25 Mar 2017 01:02:53 +0100
Subject: [PATCH 1/2] ln: make symbolic links by default:

* This commit changes the default behavior of ln.
  Instead of creating hard links the default will now
  create symbolic links.
  If you still want to create hard links the -h option is provided.

* We think that it is more natural to create symbolic links instead of
  of hardlinks. Today hardlinks are rarely used. Moreover, its much more
economical
  to save the writing effort of the additional parameter.

PS: This commit will eventually break all your systems! ;)
---
 src/ln.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/src/ln.c b/src/ln.c
index 539d238c8..634c92f7c 100644
--- a/src/ln.c
+++ b/src/ln.c
@@ -46,7 +46,7 @@
 static enum backup_type backup_type;
 
 /* If true, make symbolic links; otherwise, make hard links.  */
-static bool symbolic_link;
+static bool hard_link;
 
 /* If true, make symbolic links relative  */
 static bool relative;
@@ -97,7 +97,7 @@ static struct option const long_options[] =
   {"logical", no_argument, NULL, 'L'},
   {"physical", no_argument, NULL, 'P'},
   {"relative", no_argument, NULL, 'r'},
-  {"symbolic", no_argument, NULL, 's'},
+  {"hard", no_argument, NULL, 'h'},
   {"verbose", no_argument, NULL, 'v'},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
@@ -185,7 +185,7 @@ do_link (const char *source, const char *dest)
   bool dest_lstat_ok = false;
   bool source_is_dir = false;
 
-  if (!symbolic_link)
+  if (hard_link)
     {
        /* Which stat to use depends on whether linkat will follow the
           symlink.  We can't use the shorter
@@ -244,15 +244,15 @@ do_link (const char *source, const char *dest)
           code would give a misleading "file not found" diagnostic.
           This case is different than the others handled here, since
           the command in question doesn't use --force.  */
-       || (!symbolic_link && backup_type != no_backups))
+       || (hard_link && backup_type != no_backups))
       && dest_lstat_ok
       /* Allow 'ln -sf --backup k k' to succeed in creating the
          self-referential symlink, but don't allow the hard-linking
          equivalent: 'ln -f k k' (with or without --backup) to get
          beyond this point, because the error message you'd get is
          misleading.  */
-      && (backup_type == no_backups || !symbolic_link)
-      && (!symbolic_link || stat (source, &source_stats) == 0)
+      && (backup_type == no_backups || hard_link)
+      && (hard_link || stat (source, &source_stats) == 0)
       && SAME_INODE (source_stats, dest_stats)
       /* The following detects whether removing DEST will also remove
          SOURCE.  If the file has only one link then both are surely
@@ -320,7 +320,7 @@ do_link (const char *source, const char *dest)
      If we didn't remove DEST in that case, the subsequent symlink or link
      call would fail.  */
   bool ok_to_remove = remove_existing_files || dest_backup;
-  bool ok = 0 <= (symbolic_link
+  bool ok = 0 <= (!hard_link
                   ? force_symlinkat (source, AT_FDCWD, dest, ok_to_remove)
                   : force_linkat (AT_FDCWD, source, AT_FDCWD, dest,
                                   logical ? AT_SYMLINK_FOLLOW : 0,
@@ -330,7 +330,7 @@ do_link (const char *source, const char *dest)
     {
       /* Right after creating a hard link, do this: (note dest name and
          source_stats, which are also the just-linked-destinations
stats) */
-      if (! symbolic_link)
+      if (hard_link)
         record_file (dest_set, dest, &source_stats);
 
       if (verbose)
@@ -338,13 +338,13 @@ do_link (const char *source, const char *dest)
           if (dest_backup)
             printf ("%s ~ ", quoteaf (dest_backup));
           printf ("%s %c> %s\n", quoteaf_n (0, dest),
-                  (symbolic_link ? '-' : '='), quoteaf_n (1, source));
+                  (!hard_link ? '-' : '='), quoteaf_n (1, source));
         }
     }
   else
     {
       error (0, errno,
-             (symbolic_link
+             (!hard_link
               ? (errno != ENAMETOOLONG && *source
                  ? _("failed to create symbolic link %s")
                  : _("failed to create symbolic link %s -> %s"))
@@ -410,7 +410,7 @@ interpreted in relation to its parent directory.\n\
                                 it is a symbolic link to a directory\n\
   -P, --physical              make hard links directly to symbolic links\n\
   -r, --relative              create symbolic links relative to link
location\n\
-  -s, --symbolic              make symbolic links instead of hard links\n\
+  -h, --hard                  make hard links instead of symbolc links\n\
 "), stdout);
       fputs (_("\
   -S, --suffix=SUFFIX         override the usual backup suffix\n\
@@ -424,7 +424,7 @@ interpreted in relation to its parent directory.\n\
       emit_backup_suffix_note ();
       printf (_("\
 \n\
-Using -s ignores -L and -P.  Otherwise, the last option specified
controls\n\
+Not using -h ignores -L and -P.  Otherwise, the last option specified
controls\n\
 behavior when a TARGET is a symbolic link, defaulting to %s.\n\
 "), LINK_FOLLOWS_SYMLINKS ? "-L" : "-P");
       emit_ancillary_info (PROGRAM_NAME);
@@ -452,10 +452,10 @@ main (int argc, char **argv)
 
   atexit (close_stdin);
 
-  symbolic_link = remove_existing_files = interactive = verbose
+  hard_link = remove_existing_files = interactive = verbose
     = hard_dir_link = false;
 
-  while ((c = getopt_long (argc, argv, "bdfinrst:vFLPS:T",
long_options, NULL))
+  while ((c = getopt_long (argc, argv, "bdfinrht:vFLPS:T",
long_options, NULL))
          != -1)
     {
       switch (c)
@@ -489,8 +489,8 @@ main (int argc, char **argv)
         case 'r':
           relative = true;
           break;
-        case 's':
-          symbolic_link = true;
+        case 'h':
+          hard_link = true;
           break;
         case 't':
           if (target_directory)
@@ -566,7 +566,7 @@ main (int argc, char **argv)
                  ? xget_version (_("backup type"), version_control_string)
                  : no_backups);
 
-  if (relative && !symbolic_link)
+  if (relative && hard_link)
     {
         die (EXIT_FAILURE, 0,
              _("cannot do --relative without --symbolic"));
@@ -584,7 +584,7 @@ main (int argc, char **argv)
           && remove_existing_files
           /* Don't bother trying to protect symlinks, since ln clobbering
              a just-created symlink won't ever lead to real data loss.  */
-          && ! symbolic_link
+          && hard_link
           /* No destination hard link can be clobbered when making
              numbered backups.  */
           && backup_type != numbered_backups)
-- 
2.11.0


>From b7582eb0e5045d4c45b5b36d86f26ef9b62486fa Mon Sep 17 00:00:00 2001
From: Sebastian Oeste <address@hidden>
Date: Sat, 25 Mar 2017 01:14:09 +0100
Subject: [PATCH 2/2] tests: adjust tests to new ln functionality

---
 tests/chgrp/basic.sh                         |  2 +-
 tests/chgrp/default-no-deref.sh              |  2 +-
 tests/chgrp/deref.sh                         |  2 +-
 tests/chgrp/posix-H.sh                       |  4 ++--
 tests/chgrp/recurse.sh                       |  4 ++--
 tests/chmod/thru-dangling.sh                 |  2 +-
 tests/chown/basic.sh                         |  2 +-
 tests/chown/deref.sh                         |  2 +-
 tests/chown/preserve-root.sh                 |  2 +-
 tests/cp/abuse.sh                            |  2 +-
 tests/cp/cp-HL.sh                            |  4 ++--
 tests/cp/cp-deref.sh                         |  4 ++--
 tests/cp/cp-mv-enotsup-xattr.sh              |  2 +-
 tests/cp/cp-parents.sh                       |  2 +-
 tests/cp/deref-slink.sh                      |  2 +-
 tests/cp/fail-perm.sh                        |  2 +-
 tests/cp/link-deref.sh                       | 10 +++++-----
 tests/cp/link-no-deref.sh                    |  2 +-
 tests/cp/link-preserve.sh                    | 12 +++++------
 tests/cp/link-symlink.sh                     |  2 +-
 tests/cp/no-deref-link1.sh                   |  2 +-
 tests/cp/no-deref-link2.sh                   |  2 +-
 tests/cp/no-deref-link3.sh                   |  2 +-
 tests/cp/preserve-link.sh                    | 10 +++++-----
 tests/cp/preserve-slink-time.sh              |  2 +-
 tests/cp/r-vs-symlink.sh                     |  4 ++--
 tests/cp/same-file.sh                        | 14 ++++++-------
 tests/cp/slink-2-slink.sh                    |  8 ++++----
 tests/cp/symlink-slash.sh                    |  2 +-
 tests/cp/thru-dangling.sh                    |  2 +-
 tests/dd/misc.sh                             |  4 ++--
 tests/df/df-symlink.sh                       |  2 +-
 tests/du/deref-args.sh                       |  4 ++--
 tests/du/deref.sh                            |  6 +++---
 tests/du/hard-link.sh                        |  4 ++--
 tests/du/inodes.sh                           |  2 +-
 tests/du/long-sloop.sh                       |  2 +-
 tests/du/no-deref.sh                         |  2 +-
 tests/du/one-file-system.sh                  |  2 +-
 tests/du/trailing-slash.sh                   |  2 +-
 tests/install/install-C.sh                   |  4 ++--
 tests/ln/backup-1.sh                         |  4 ++--
 tests/ln/hard-backup.sh                      |  2 +-
 tests/ln/hard-to-sym.sh                      | 24 +++++++++++-----------
 tests/ln/misc.sh                             | 30
++++++++++++++--------------
 tests/ln/relative.sh                         | 18 ++++++++---------
 tests/ln/sf-1.sh                             | 16 +++++++--------
 tests/ln/slash-decorated-nonexistent-dest.sh |  2 +-
 tests/ln/target-1.sh                         |  2 +-
 tests/ls/dangle.sh                           |  6 +++---
 tests/ls/file-type.sh                        |  6 +++---
 tests/ls/follow-slink.sh                     |  6 +++---
 tests/ls/infloop.sh                          |  4 ++--
 tests/ls/inode.sh                            |  2 +-
 tests/ls/multihardlink.sh                    |  2 +-
 tests/ls/no-arg.sh                           |  2 +-
 tests/ls/slink-acl.sh                        |  2 +-
 tests/ls/stat-dtype.sh                       |  2 +-
 tests/ls/stat-failed.sh                      |  2 +-
 tests/ls/stat-free-color.sh                  |  6 +++---
 tests/ls/stat-free-symlinks.sh               |  2 +-
 tests/ls/symlink-slash.sh                    |  2 +-
 tests/misc/chroot-fail.sh                    |  2 +-
 tests/misc/close-stdout.sh                   |  2 +-
 tests/misc/env.sh                            |  4 ++--
 tests/misc/help-version.sh                   |  2 +-
 tests/misc/ls-time.sh                        |  4 ++--
 tests/misc/pwd-option.sh                     |  2 +-
 tests/misc/readlink-fp-loop.sh               | 22 ++++++++++----------
 tests/misc/readlink-root.sh                  | 18 ++++++++---------
 tests/misc/realpath.sh                       |  8 ++++----
 tests/misc/stat-slash.sh                     |  4 ++--
 tests/misc/truncate-dangling-symlink.sh      |  2 +-
 tests/mkdir/p-thru-slink.sh                  |  2 +-
 tests/mv/atomic.sh                           |  8 ++++----
 tests/mv/atomic2.sh                          |  2 +-
 tests/mv/childproof.sh                       |  4 ++--
 tests/mv/force.sh                            |  2 +-
 tests/mv/hard-2.sh                           |  4 ++--
 tests/mv/hard-3.sh                           |  4 ++--
 tests/mv/hard-4.sh                           |  2 +-
 tests/mv/hard-link-1.sh                      |  2 +-
 tests/mv/hardlink-case.sh                    |  2 +-
 tests/mv/i-4.sh                              |  2 +-
 tests/mv/i-link-no.sh                        |  4 ++--
 tests/mv/into-self-2.sh                      |  2 +-
 tests/mv/into-self-4.sh                      |  2 +-
 tests/mv/part-hardlink.sh                    |  4 ++--
 tests/mv/part-symlink.sh                     |  2 +-
 tests/mv/symlink-onto-hardlink-to-self.sh    |  4 ++--
 tests/mv/symlink-onto-hardlink.sh            |  4 ++--
 tests/mv/to-symlink.sh                       |  2 +-
 tests/readlink/can-e.sh                      |  8 ++++----
 tests/readlink/can-f.sh                      | 10 +++++-----
 tests/readlink/can-m.sh                      |  8 ++++----
 tests/readlink/multi.sh                      |  2 +-
 tests/readlink/rl-1.sh                       |  4 ++--
 tests/rm/dangling-symlink.sh                 |  4 ++--
 tests/rm/fail-eacces.sh                      |  4 ++--
 tests/rm/r-root.sh                           |  6 +++---
 tests/rm/rm3.sh                              |  4 ++--
 tests/split/guard-input.sh                   |  4 ++--
 tests/tail-2/symlink.sh                      |  6 +++---
 tests/touch/dangling-symlink.sh              |  2 +-
 tests/touch/no-dereference.sh                |  4 ++--
 tests/touch/trailing-slash.sh                |  8 ++++----
 106 files changed, 246 insertions(+), 246 deletions(-)

diff --git a/tests/chgrp/basic.sh b/tests/chgrp/basic.sh
index 0b06fca22..1c30359a4 100755
--- a/tests/chgrp/basic.sh
+++ b/tests/chgrp/basic.sh
@@ -49,7 +49,7 @@ chgrp $g2 d    ||fail=1; test $(stat --p=%g: $d_files)
= "$g2:$g1:" || fail=1
 
 rm -f f
 touch f
-ln -s f symlink
+ln f symlink
 chgrp $g1 f
 test $(stat --printf=%g f) = $g1 || fail=1
 
diff --git a/tests/chgrp/default-no-deref.sh
b/tests/chgrp/default-no-deref.sh
index d91496cf1..61588f0c5 100755
--- a/tests/chgrp/default-no-deref.sh
+++ b/tests/chgrp/default-no-deref.sh
@@ -24,7 +24,7 @@ require_local_dir_
 set _ $groups; shift
 g2=$2
 
-mkdir d && touch f && ln -s ../f d/s || framework_failure_
+mkdir d && touch f && ln ../f d/s || framework_failure_
 
 
 g_init=$(stat --printf=%g f)
diff --git a/tests/chgrp/deref.sh b/tests/chgrp/deref.sh
index dbc65fb32..c22a7e984 100755
--- a/tests/chgrp/deref.sh
+++ b/tests/chgrp/deref.sh
@@ -25,7 +25,7 @@ g1=$1
 g2=$2
 
 touch f
-ln -s f symlink
+ln f symlink
 
 chgrp -h $g2 symlink 2> /dev/null
 set _ $(ls -ln symlink)
diff --git a/tests/chgrp/posix-H.sh b/tests/chgrp/posix-H.sh
index 7a1355ba1..caab9101b 100755
--- a/tests/chgrp/posix-H.sh
+++ b/tests/chgrp/posix-H.sh
@@ -27,8 +27,8 @@ g2=$2
 
 mkdir 1 2 3 || framework_failure_
 touch 1/1F 2/2F 3/3F || framework_failure_
-ln -s 1 1s || framework_failure_
-ln -s ../3 2/2s || framework_failure_
+ln 1 1s || framework_failure_
+ln ../3 2/2s || framework_failure_
 chgrp -R $g1 1 2 3 || framework_failure_
 
 
diff --git a/tests/chgrp/recurse.sh b/tests/chgrp/recurse.sh
index c1545ac54..ee83a11dd 100755
--- a/tests/chgrp/recurse.sh
+++ b/tests/chgrp/recurse.sh
@@ -29,7 +29,7 @@ g2=$2
 # chgrp -R should not traverse a symlink to a directory.
 mkdir d e
 touch d/dd e/ee
-ln -s ../e d/s
+ln ../e d/s
 chgrp -R $g1 e/ee || fail=1
 # This should not should change the group of e/ee
 chgrp -R $g2 d
@@ -43,7 +43,7 @@ set _ $(ls -ln e/ee); g=$5; test "$g" = $g2 || fail=1
 chgrp -H -R $g1 d
 set _ $(ls -ln e/ee); g=$5; test "$g" = $g2 || fail=1
 
-ln -s d link
+ln d link
 
 # This shouldn't change the group of e/ee either.
 chgrp -H -R $g1 link || fail=1
diff --git a/tests/chmod/thru-dangling.sh b/tests/chmod/thru-dangling.sh
index 42617d52b..8584ad43b 100755
--- a/tests/chmod/thru-dangling.sh
+++ b/tests/chmod/thru-dangling.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ chmod
 
-ln -s non-existent dangle || framework_failure_
+ln non-existent dangle || framework_failure_
 
 
 # This operation cannot succeed since the symbolic link dangles.
diff --git a/tests/chown/basic.sh b/tests/chown/basic.sh
index e0b3d7166..ee99a3bc3 100755
--- a/tests/chown/basic.sh
+++ b/tests/chown/basic.sh
@@ -43,7 +43,7 @@ chown --from=0:1 2:010 f || fail=1
 # And now they should be 2 and 10 respectively.
 set _ $(ls -n f); shift; test "$3:$4" = 2:10 || fail=1
 
-ln -s f slink
+ln f slink
 # Applying chown to a symlink with --no-dereference
 # should change only the link.
 chown --no-dereference 0:1 slink || fail=1
diff --git a/tests/chown/deref.sh b/tests/chown/deref.sh
index 4c8628dea..1ae160779 100755
--- a/tests/chown/deref.sh
+++ b/tests/chown/deref.sh
@@ -20,7 +20,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ chown
 
-ln -s no-such dangle || framework_failure_
+ln no-such dangle || framework_failure_
 
 
 set _ $(ls -ldo dangle); shift; user=$3
diff --git a/tests/chown/preserve-root.sh b/tests/chown/preserve-root.sh
index 76d0a3fd0..dcdd3d596 100755
--- a/tests/chown/preserve-root.sh
+++ b/tests/chown/preserve-root.sh
@@ -20,7 +20,7 @@
 print_ver_ chown
 skip_if_root_
 
-mkdir d && ln -s / d/slink-to-root
+mkdir d && ln / d/slink-to-root
 
 
 # Even if --preserve-root were to malfunction, allowing the chown or
diff --git a/tests/cp/abuse.sh b/tests/cp/abuse.sh
index 95b083bae..e3920b9c2 100755
--- a/tests/cp/abuse.sh
+++ b/tests/cp/abuse.sh
@@ -20,7 +20,7 @@
 print_ver_ cp
 
 mkdir a b c || framework_failure_
-ln -s ../t a/1 || framework_failure_
+ln ../t a/1 || framework_failure_
 echo payload > b/1 || framework_failure_
 
 echo "cp: will not copy 'b/1' through just-created symlink 'c/1'" \
diff --git a/tests/cp/cp-HL.sh b/tests/cp/cp-HL.sh
index 96b433d84..de952324e 100755
--- a/tests/cp/cp-HL.sh
+++ b/tests/cp/cp-HL.sh
@@ -21,8 +21,8 @@ print_ver_ cp
 
 mkdir src-dir dest-dir || framework_failure_
 echo f > f || framework_failure_
-ln -s f slink || framework_failure_
-ln -s no-such-file src-dir/slink || framework_failure_
+ln f slink || framework_failure_
+ln no-such-file src-dir/slink || framework_failure_
 
 
 cp -H -R slink src-dir dest-dir || fail=1
diff --git a/tests/cp/cp-deref.sh b/tests/cp/cp-deref.sh
index fe1193948..cc1f7bfda 100755
--- a/tests/cp/cp-deref.sh
+++ b/tests/cp/cp-deref.sh
@@ -21,8 +21,8 @@
 print_ver_ cp
 
 mkdir a b c d || framework_failure_
-ln -s ../c a || framework_failure_
-ln -s ../c b || framework_failure_
+ln ../c a || framework_failure_
+ln ../c b || framework_failure_
 
 
 # Before coreutils-5.94, the following would fail with this message:
diff --git a/tests/cp/cp-mv-enotsup-xattr.sh
b/tests/cp/cp-mv-enotsup-xattr.sh
index 73eff22a7..0a904c54d 100755
--- a/tests/cp/cp-mv-enotsup-xattr.sh
+++ b/tests/cp/cp-mv-enotsup-xattr.sh
@@ -110,7 +110,7 @@ compare /dev/null err || fail=1
 # since the xattrs used here are not in the 'user.' namespace.
 # Up to and including coreutils-8.22 xattrs of symlinks
 # were not copied across file systems.
-ln -s 'foo' xattr/symlink || framework_failure_
+ln 'foo' xattr/symlink || framework_failure_
 # Note 'user.' namespace is only supported on regular files/dirs
 # so use the 'trusted.' namespace here
 txattr='trusted.overlay.whiteout'
diff --git a/tests/cp/cp-parents.sh b/tests/cp/cp-parents.sh
index de9b0f779..25f186781 100755
--- a/tests/cp/cp-parents.sh
+++ b/tests/cp/cp-parents.sh
@@ -26,7 +26,7 @@ skip_if_setgid_
 {
   mkdir foo bar
   mkdir -p a/b/c d e g
-  ln -s d/a sym
+  ln d/a sym
   touch f
 } || framework_failure_
 
diff --git a/tests/cp/deref-slink.sh b/tests/cp/deref-slink.sh
index f8ef0fb70..9639e566d 100755
--- a/tests/cp/deref-slink.sh
+++ b/tests/cp/deref-slink.sh
@@ -21,7 +21,7 @@
 print_ver_ cp
 
 touch f slink-target || framework_failure_
-ln -s slink-target slink || framework_failure_
+ln slink-target slink || framework_failure_
 
 cp -d f slink || fail=1
 
diff --git a/tests/cp/fail-perm.sh b/tests/cp/fail-perm.sh
index 43d1f9ad5..1440a3120 100755
--- a/tests/cp/fail-perm.sh
+++ b/tests/cp/fail-perm.sh
@@ -35,7 +35,7 @@ mode=$(ls -ld DD|cut -b-10)
 test "$mode" = dr-x------ || fail=1
 
 chmod 0 D
-ln -s D/D symlink
+ln D/D symlink
 touch F
 cat > exp <<\EOF
 cp: failed to access 'symlink': Permission denied
diff --git a/tests/cp/link-deref.sh b/tests/cp/link-deref.sh
index bb1e3c62c..67d3445f6 100755
--- a/tests/cp/link-deref.sh
+++ b/tests/cp/link-deref.sh
@@ -24,8 +24,8 @@ if { grep '^#define HAVE_LINKAT 1' "$CONFIG_HEADER" >
/dev/null \
    || grep '^#define LINK_FOLLOWS_SYMLINKS 0' "$CONFIG_HEADER" >
/dev/null; then
   # With this config cp will attempt to linkat() to hardlink a symlink.
   # So now double check the current file system supports this operation.
-  ln -s testtarget test_sl || framework_failure_
-  ln -P test_sl test_hl_sl || framework_failure_
+  ln testtarget test_sl || framework_failure_
+  ln -hP test_sl test_hl_sl || framework_failure_
   ino_sl="$(stat -c '%i' test_sl)" || framework_failure_
   ino_hl="$(stat -c '%i' test_hl_sl)" || framework_failure_
   test "$ino_sl" = "$ino_hl" && can_hardlink_to_symlink=1
@@ -33,9 +33,9 @@ fi
 
 mkdir dir              || framework_failure_
 > file                 || framework_failure_
-ln -s dir     dirlink  || framework_failure_
-ln -s file    filelink || framework_failure_
-ln -s nowhere danglink || framework_failure_
+ln dir     dirlink  || framework_failure_
+ln file    filelink || framework_failure_
+ln nowhere danglink || framework_failure_
 
 # printf format of the output line.
 outformat='%s|result=%s|inode=%s|type=%s|error=%s\n'
diff --git a/tests/cp/link-no-deref.sh b/tests/cp/link-no-deref.sh
index 17efd311d..69dd1732c 100755
--- a/tests/cp/link-no-deref.sh
+++ b/tests/cp/link-no-deref.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ cp
 
-ln -s no-such-file dangling-slink || framework_failure_
+ln no-such-file dangling-slink || framework_failure_
 
 
 # Prior to coreutils-6.0, this would fail on non-Linux kernels,
diff --git a/tests/cp/link-preserve.sh b/tests/cp/link-preserve.sh
index 9755d9e03..ecc8abca8 100755
--- a/tests/cp/link-preserve.sh
+++ b/tests/cp/link-preserve.sh
@@ -21,7 +21,7 @@
 print_ver_ cp
 
 touch a || framework_failure_
-ln a b || framework_failure_
+ln -h a b || framework_failure_
 mkdir c || framework_failure_
 cp -d a b c || framework_failure_
 test -f c/a || framework_failure_
@@ -35,7 +35,7 @@ test "$a_inode" = "$b_inode" || fail=1
 
 rm -rf a b c
 touch a
-ln -s a b
+ln a b
 mkdir c
 cp --preserve=links -R -H a b c || fail=1
 a_inode=$(ls -i c/a|sed 's,c/.*,,')
@@ -45,7 +45,7 @@ test "$a_inode" = "$b_inode" || fail=1
 
 # Ensure that -L makes cp follow the b->a symlink
 # and translates to hard-linked a and b in the destination dir.
-rm -rf a b c d; mkdir d; (cd d; touch a; ln -s a b)
+rm -rf a b c d; mkdir d; (cd d; touch a; ln a b)
 cp --preserve=links -R -L d c || fail=1
 a_inode=$(ls -i c/a|sed 's,c/.*,,')
 b_inode=$(ls -i c/b|sed 's,c/.*,,')
@@ -53,7 +53,7 @@ test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
 # Same as above, but starting with a/b hard linked.
-rm -rf a b c d; mkdir d; (cd d; touch a; ln a b)
+rm -rf a b c d; mkdir d; (cd d; touch a; ln -h a b)
 cp --preserve=links -R -L d c || fail=1
 a_inode=$(ls -i c/a|sed 's,c/.*,,')
 b_inode=$(ls -i c/b|sed 's,c/.*,,')
@@ -61,7 +61,7 @@ test "$a_inode" = "$b_inode" || fail=1
 # --------------------------------------
 
 # Ensure that --no-preserve=links works.
-rm -rf a b c d; mkdir d; (cd d; touch a; ln a b)
+rm -rf a b c d; mkdir d; (cd d; touch a; ln -h a b)
 cp -dR --no-preserve=links d c || fail=1
 a_inode=$(ls -i c/a|sed 's,c/.*,,')
 b_inode=$(ls -i c/b|sed 's,c/.*,,')
@@ -70,7 +70,7 @@ test "$a_inode" = "$b_inode" && fail=1
 
 # Ensure that -d still preserves hard links.
 rm -rf a b c d
-touch a; ln a b
+touch a; ln -h a b
 mkdir c
 cp -d a b c || fail=1
 a_inode=$(ls -i c/a|sed 's,c/.*,,')
diff --git a/tests/cp/link-symlink.sh b/tests/cp/link-symlink.sh
index 168d1782e..03bb29389 100755
--- a/tests/cp/link-symlink.sh
+++ b/tests/cp/link-symlink.sh
@@ -22,7 +22,7 @@ print_ver_ cp
 # Check that the timestamps of the symlink are copied
 # if we're using hardlink to symlink emulation.
 touch file
-ln -s file link || framework_failure_
+ln file link || framework_failure_
 touch -m -h -d 2011-01-01 link ||
   skip_ "Your system doesn't support updating symlink timestamps"
 case $(stat --format=%y link) in
diff --git a/tests/cp/no-deref-link1.sh b/tests/cp/no-deref-link1.sh
index ea442cdbf..d1b3b3190 100755
--- a/tests/cp/no-deref-link1.sh
+++ b/tests/cp/no-deref-link1.sh
@@ -23,7 +23,7 @@ mkdir a b
 msg=bar
 echo $msg > a/foo
 cd b
-ln -s ../a/foo .
+ln ../a/foo .
 cd ..
 
 
diff --git a/tests/cp/no-deref-link2.sh b/tests/cp/no-deref-link2.sh
index 518b1bb2f..0aa56b5a4 100755
--- a/tests/cp/no-deref-link2.sh
+++ b/tests/cp/no-deref-link2.sh
@@ -23,7 +23,7 @@ mkdir b
 msg=bar
 echo $msg > a
 cd b
-ln -s ../a .
+ln ../a .
 cd ..
 
 
diff --git a/tests/cp/no-deref-link3.sh b/tests/cp/no-deref-link3.sh
index 68d297357..638f43c6a 100755
--- a/tests/cp/no-deref-link3.sh
+++ b/tests/cp/no-deref-link3.sh
@@ -21,7 +21,7 @@ print_ver_ cp
 
 msg=bar
 echo $msg > a
-ln -s a b
+ln a b
 
 
 # It should fail with a message something like this:
diff --git a/tests/cp/preserve-link.sh b/tests/cp/preserve-link.sh
index 19ee51742..98b5a8edb 100755
--- a/tests/cp/preserve-link.sh
+++ b/tests/cp/preserve-link.sh
@@ -33,16 +33,16 @@ create_source_tree()
 
   # a missing link in dest will be created
   touch s/f || framework_failure_
-  ln s/f s/linkm || framework_failure_
+  ln -h s/f s/linkm || framework_failure_
 
   # an existing link in dest will be maintained
-  ln s/f s/linke || framework_failure_
+  ln -h s/f s/linke || framework_failure_
 
   # a separate older file in dest will be overwritten
-  ln s/f s/fileo || framework_failure_
+  ln -h s/f s/fileo || framework_failure_
 
   # a separate newer file in dest will be overwritten!
-  ln s/f s/fileu || framework_failure_
+  ln -h s/f s/fileu || framework_failure_
 }
 
 create_target_tree()
@@ -56,7 +56,7 @@ create_target_tree()
   touch t/s/$f || framework_failure_
 
   # an existing link must be maintained
-  ln t/s/$f t/s/linke || framework_failure_
+  ln -h t/s/$f t/s/linke || framework_failure_
 
   # a separate older file in dest will be overwritten
   touch -d '-1 hour' t/s/fileo || framework_failure_
diff --git a/tests/cp/preserve-slink-time.sh
b/tests/cp/preserve-slink-time.sh
index c8da0cd1a..b93568db7 100755
--- a/tests/cp/preserve-slink-time.sh
+++ b/tests/cp/preserve-slink-time.sh
@@ -23,7 +23,7 @@ grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" >
/dev/null ||
 grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
   skip_ 'this system lacks the utimensat function'
 
-ln -s no-such dangle || framework_failure_
+ln no-such dangle || framework_failure_
 
 # If the current file system lacks sub-second resolution, sleep for 2s to
 # ensure that the times on the copy are different from those of the
original.
diff --git a/tests/cp/r-vs-symlink.sh b/tests/cp/r-vs-symlink.sh
index 5bd58694e..40a26e9bd 100755
--- a/tests/cp/r-vs-symlink.sh
+++ b/tests/cp/r-vs-symlink.sh
@@ -24,8 +24,8 @@
 print_ver_ cp
 
 echo abc > foo || framework_failure_
-ln -s foo slink || framework_failure_
-ln -s no-such-file no-file || framework_failure_
+ln foo slink || framework_failure_
+ln no-such-file no-file || framework_failure_
 
 
 # This would fail in 4.1.5, not in 4.1.6.
diff --git a/tests/cp/same-file.sh b/tests/cp/same-file.sh
index 9aa6a2112..83262bda4 100755
--- a/tests/cp/same-file.sh
+++ b/tests/cp/same-file.sh
@@ -29,8 +29,8 @@ VERSION_CONTROL=numbered; export VERSION_CONTROL
 # Determine whether a hard link to a symlink points to the symlink
 # itself or to its referent.  For example, the link from FreeBSD6.1
 # does dereference a symlink, but the one from Linux does not.
-ln -s no-such dangling-slink
-ln dangling-slink hard-link > /dev/null 2>&1 \
+ln no-such dangling-slink
+ln -h dangling-slink hard-link > /dev/null 2>&1 \
   && hard_link_to_symlink_does_the_deref=no \
   || hard_link_to_symlink_does_the_deref=yes
 rm -f no-such dangling-slink hard-link
@@ -85,11 +85,11 @@ for args in 'foo symlink' 'symlink foo' 'foo foo'
'sl1 sl2' \
     mkdir dir
     cd dir
     echo $contents > foo
-    case "$args" in *symlink*) ln -s foo symlink ;; esac
-    case "$args" in *hardlink*) ln foo hardlink ;; esac
-    case "$args" in *sl1*) ln -s foo sl1;; esac
-    case "$args" in *sl2*) ln -s foo sl2;; esac
-    case "$args" in *hlsl*) ln sl2 hlsl;; esac
+    case "$args" in *symlink*) ln foo symlink ;; esac
+    case "$args" in *hardlink*) ln -h foo hardlink ;; esac
+    case "$args" in *sl1*) ln foo sl1;; esac
+    case "$args" in *sl2*) ln foo sl2;; esac
+    case "$args" in *hlsl*) ln -h sl2 hlsl;; esac
     (
       (
         # echo 1>&2 cp $options $args
diff --git a/tests/cp/slink-2-slink.sh b/tests/cp/slink-2-slink.sh
index caead978c..8d3d92c74 100755
--- a/tests/cp/slink-2-slink.sh
+++ b/tests/cp/slink-2-slink.sh
@@ -21,10 +21,10 @@
 print_ver_ cp
 
 touch file || framework_failure_
-ln -s file a || framework_failure_
-ln -s file b || framework_failure_
-ln -s no-such-file c || framework_failure_
-ln -s no-such-file d || framework_failure_
+ln file a || framework_failure_
+ln file b || framework_failure_
+ln no-such-file c || framework_failure_
+ln no-such-file d || framework_failure_
 
 cp --update --no-dereference a b || fail=1
 cp --update --no-dereference c d || fail=1
diff --git a/tests/cp/symlink-slash.sh b/tests/cp/symlink-slash.sh
index 45c5b91f8..46fd2febe 100755
--- a/tests/cp/symlink-slash.sh
+++ b/tests/cp/symlink-slash.sh
@@ -21,7 +21,7 @@
 print_ver_ cp
 
 mkdir dir || framework_failure_
-ln -s dir symlink || framework_failure_
+ln dir symlink || framework_failure_
 
 cp -dR symlink/ s || fail=1
 set $(ls -l s)
diff --git a/tests/cp/thru-dangling.sh b/tests/cp/thru-dangling.sh
index 333d15598..2683f7930 100755
--- a/tests/cp/thru-dangling.sh
+++ b/tests/cp/thru-dangling.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ cp
 
-ln -s no-such dangle || framework_failure_
+ln no-such dangle || framework_failure_
 echo hi > f || framework_failure_
 echo hi > exp || framework_failure_
 echo "cp: not writing through dangling symlink 'dangle'" \
diff --git a/tests/dd/misc.sh b/tests/dd/misc.sh
index 48b7806fd..538c78199 100755
--- a/tests/dd/misc.sh
+++ b/tests/dd/misc.sh
@@ -27,8 +27,8 @@ tmp_out=dd-out
 
 warn=0
 echo data > $tmp_in || framework_failure_
-ln $tmp_in $tmp_in2 || framework_failure_
-ln -s $tmp_in $tmp_sym || framework_failure_
+ln -h $tmp_in $tmp_in2 || framework_failure_
+ln $tmp_in $tmp_sym || framework_failure_
 
 # check status=none suppresses all output to stderr
 dd status=none if=$tmp_in of=/dev/null 2> err || fail=1
diff --git a/tests/df/df-symlink.sh b/tests/df/df-symlink.sh
index 873adaa9f..fc5cd8933 100755
--- a/tests/df/df-symlink.sh
+++ b/tests/df/df-symlink.sh
@@ -22,7 +22,7 @@ print_ver_ df
 disk=$(df --out=source '.' | tail -n1) ||
   skip_ "cannot determine '.' file system"
 
-ln -s "$disk" symlink || framework_failure_
+ln "$disk" symlink || framework_failure_
 
 df --out=source,target "$disk" > exp || skip_ "cannot get info for $disk"
 df --out=source,target symlink > out || fail=1
diff --git a/tests/du/deref-args.sh b/tests/du/deref-args.sh
index f47e78147..7b29c5d1c 100755
--- a/tests/du/deref-args.sh
+++ b/tests/du/deref-args.sh
@@ -21,9 +21,9 @@
 print_ver_ du
 
 mkdir -p dir/a || framework_failure_
-ln -s dir slink || framework_failure_
+ln dir slink || framework_failure_
 printf %65536s x > 64k || framework_failure_
-ln -s 64k slink-to-64k || framework_failure_
+ln 64k slink-to-64k || framework_failure_
 
 
 du -D slink | sed 's/^[0-9][0-9]*    //' > out
diff --git a/tests/du/deref.sh b/tests/du/deref.sh
index ade6332fd..2b473000b 100755
--- a/tests/du/deref.sh
+++ b/tests/du/deref.sh
@@ -23,10 +23,10 @@
 print_ver_ du
 
 mkdir -p a/sub || framework_failure_
-ln -s a/sub slink || framework_failure_
+ln a/sub slink || framework_failure_
 touch b || framework_failure_
-ln -s .. a/sub/dotdot || framework_failure_
-ln -s nowhere dangle || framework_failure_
+ln .. a/sub/dotdot || framework_failure_
+ln nowhere dangle || framework_failure_
 
 
 # This used to fail with the following diagnostic:
diff --git a/tests/du/hard-link.sh b/tests/du/hard-link.sh
index 4d8f0bcdb..717265518 100755
--- a/tests/du/hard-link.sh
+++ b/tests/du/hard-link.sh
@@ -24,8 +24,8 @@ print_ver_ du
 mkdir -p dir/sub
 ( cd dir &&
   { echo non-empty > f1
-    ln f1 f2
-    ln -s f1 f3
+    ln -h f1 f2
+    ln f1 f3
     echo non-empty > sub/F; } )
 
 du -a -L --exclude=sub --count-links dir \
diff --git a/tests/du/inodes.sh b/tests/du/inodes.sh
index 49d5134f3..e8a33b95f 100755
--- a/tests/du/inodes.sh
+++ b/tests/du/inodes.sh
@@ -36,7 +36,7 @@ compare exp out || fail=1
 compare /dev/null err || fail=1
 
 # Add a hardlink to the file: still only 2 inodes used.
-ln -v d/f d/h || framework_failure_
+ln -h -v d/f d/h || framework_failure_
 du --inodes d > out 2>err || fail=1
 compare exp out || fail=1
 compare /dev/null err || fail=1
diff --git a/tests/du/long-sloop.sh b/tests/du/long-sloop.sh
index beb557dd6..7b2ae4565 100755
--- a/tests/du/long-sloop.sh
+++ b/tests/du/long-sloop.sh
@@ -37,7 +37,7 @@ for i in $dir_list $(expr $n + 1); do
   case $i_minus_1 in
   0) ;;
   *)
-    ln -s ../$i $i_minus_1/s || framework_failure_
+    ln ../$i $i_minus_1/s || framework_failure_
     file=$file/s;;
   esac
   i_minus_1=$i
diff --git a/tests/du/no-deref.sh b/tests/du/no-deref.sh
index c5be8a882..07e8ebe3e 100755
--- a/tests/du/no-deref.sh
+++ b/tests/du/no-deref.sh
@@ -20,7 +20,7 @@
 print_ver_ du
 
 mkdir -p dir/a/b || framework_failure_
-ln -s dir slink || framework_failure_
+ln dir slink || framework_failure_
 
 
 du slink | sed 's/^[0-9][0-9]*    //' > out
diff --git a/tests/du/one-file-system.sh b/tests/du/one-file-system.sh
index e21c90c3b..e031f0dbe 100755
--- a/tests/du/one-file-system.sh
+++ b/tests/du/one-file-system.sh
@@ -22,7 +22,7 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_srcdir/tests/other-fs-tmpdir"
 
 mkdir -p b/c y/z d "$other_partition_tmpdir/x" || framework_failure_
-ln -s "$other_partition_tmpdir/x" d || framework_failure_
+ln "$other_partition_tmpdir/x" d || framework_failure_
 
 # Due to a used-uninitialized variable, the "du -x" from coreutils-6.6
 # would not traverse into second and subsequent directories listed
diff --git a/tests/du/trailing-slash.sh b/tests/du/trailing-slash.sh
index 778050705..52256a096 100755
--- a/tests/du/trailing-slash.sh
+++ b/tests/du/trailing-slash.sh
@@ -23,7 +23,7 @@
 print_ver_ du
 
 mkdir -p dir/1/2 || framework_failure_
-ln -s dir slink || framework_failure_
+ln dir slink || framework_failure_
 
 
 du slink/ | sed 's/^[0-9][0-9]*    //' > out
diff --git a/tests/install/install-C.sh b/tests/install/install-C.sh
index 4accc78c1..fad80cf54 100755
--- a/tests/install/install-C.sh
+++ b/tests/install/install-C.sh
@@ -79,8 +79,8 @@ ginstall -Cv -m$mode3 a b > out || fail=1
 compare out out_installed_second || fail=1
 
 # files are not regular files
-ln -s a c || framework_failure_
-ln -s b d || framework_failure_
+ln a c || framework_failure_
+ln b d || framework_failure_
 ginstall -Cv -m$mode1 c d > out || fail=1
 echo "removed 'd'
 'c' -> 'd'" > out_installed_second_cd
diff --git a/tests/ln/backup-1.sh b/tests/ln/backup-1.sh
index 1022fab6a..3e1ad7d92 100755
--- a/tests/ln/backup-1.sh
+++ b/tests/ln/backup-1.sh
@@ -24,7 +24,7 @@ print_ver_ ln
 
 touch a b || framework_failure_
 
-ln b b~ || fail=1
-ln -f --b=simple a b || fail=1
+ln -h b b~ || fail=1
+ln -h -f --b=simple a b || fail=1
 
 Exit $fail
diff --git a/tests/ln/hard-backup.sh b/tests/ln/hard-backup.sh
index a983292f4..a766c0fb5 100755
--- a/tests/ln/hard-backup.sh
+++ b/tests/ln/hard-backup.sh
@@ -22,7 +22,7 @@ print_ver_ ln
 touch f || framework_failure_
 
 
-ln --backup f f 2> out && fail=1
+ln -h --backup f f 2> out && fail=1
 cat <<\EOF > exp || fail=1
 ln: 'f' and 'f' are the same file
 EOF
diff --git a/tests/ln/hard-to-sym.sh b/tests/ln/hard-to-sym.sh
index 77467061c..31a762a7c 100755
--- a/tests/ln/hard-to-sym.sh
+++ b/tests/ln/hard-to-sym.sh
@@ -23,13 +23,13 @@ print_ver_ ln
 # ===================================================
 # ensure -s silently overrides -L, -P
 touch a || framework_failure_
-ln -L -s a symlink1 || fail=1
-ln -P -s symlink1 symlink2 || fail=1
-ln -s -L -P symlink2 symlink3 || fail=1
+ln -L  a symlink1 || fail=1
+ln -P  symlink1 symlink2 || fail=1
+ln -L -P symlink2 symlink3 || fail=1
 
 # ===================================================
 # ensure that -L follows symlinks, and overrides -P
-if ln -P -L symlink3 hard-to-a; then
+if ln -h -P -L symlink3 hard-to-a; then
   ls=$(ls -lG hard-to-a)x
   case "$ls" in
     *'hard-to-ax') ;;
@@ -42,7 +42,7 @@ fi
 
 # ===================================================
 # ensure that -P links (or at least duplicates) symlinks, and overrides -L
-if ln -L -P symlink3 hard-to-3; then
+if ln -h -L -P symlink3 hard-to-3; then
   ls=$(ls -lG hard-to-3)x
   case "$ls" in
     *'hard-to-3 -> symlink2x') ;;
@@ -56,28 +56,28 @@ fi
 
 # ===================================================
 # Create a hard link to a dangling symlink.
-ln -s /no-such-dir || framework_failure_
-ln -L no-such-dir hard-to-dangle 2>err && fail=1
+ln /no-such-dir || framework_failure_
+ln -h -L no-such-dir hard-to-dangle 2>err && fail=1
 case $(cat err) in
   *" failed to access 'no-such-dir'":*) ;;
   *) fail=1 ;;
 esac
-ln -P no-such-dir hard-to-dangle || fail=1
+ln -h -P no-such-dir hard-to-dangle || fail=1
 
 # ===================================================
 # Create a hard link to a symlink to a directory.
 mkdir d || framework_failure_
-ln -s d link-to-dir || framework_failure_
-ln -L link-to-dir hard-to-dir-link 2>err && fail=1
+ln d link-to-dir || framework_failure_
+ln -h -L link-to-dir hard-to-dir-link 2>err && fail=1
 case $(cat err) in
   *": link-to-dir: hard link not allowed for directory"*) ;;
   *) fail=1 ;;
 esac
-ln -P link-to-dir/ hard-to-dir-link 2>err && fail=1
+ln -h -P link-to-dir/ hard-to-dir-link 2>err && fail=1
 case $(cat err) in
   *": link-to-dir/: hard link not allowed for directory"*) ;;
   *) fail=1 ;;
 esac
-ln -P link-to-dir hard-to-dir-link || fail=1
+ln -h -P link-to-dir hard-to-dir-link || fail=1
 
 Exit $fail
diff --git a/tests/ln/misc.sh b/tests/ln/misc.sh
index 73fa07d47..34ad72424 100755
--- a/tests/ln/misc.sh
+++ b/tests/ln/misc.sh
@@ -28,7 +28,7 @@ f=tln-file
 # in current directory.
 touch $f || framework_failure_
 rm -f $t || framework_failure_
-ln -s $f $t || fail=1
+ln $f $t || fail=1
 test -f $t || fail=1
 rm $t $f
 
@@ -36,7 +36,7 @@ rm $t $f
 touch $f || framework_failure_
 rm -rf $d || framework_failure_
 mkdir $d || framework_failure_
-ln -s ../$f $d/$t || fail=1
+ln ../$f $d/$t || fail=1
 test -f $d/$t || fail=1
 rm -rf $d $f
 
@@ -44,7 +44,7 @@ rm -rf $d $f
 touch $f || framework_failure_
 rm -rf $d || framework_failure_
 mkdir $d || framework_failure_
-ln -s ../$f $d || fail=1
+ln ../$f $d || fail=1
 test -f $d/$f || fail=1
 rm -rf $d $f
 
@@ -52,27 +52,27 @@ rm -rf $d $f
 touch $f || framework_failure_
 rm -rf $d || framework_failure_
 mkdir $d $d/$f || framework_failure_
+returns_ 1 ln -h $f $d/ 2> /dev/null || fail=1
 returns_ 1 ln $f $d/ 2> /dev/null || fail=1
-returns_ 1 ln -s $f $d/ 2> /dev/null || fail=1
 rm -rf $d $f
 
 # Make sure we get a failure with existing dest without -f option
 touch $t || framework_failure_
 # FIXME: don't ignore the error message but rather test
 # it to make sure it's the right one.
-returns_ 1 ln -s $t $t 2> /dev/null || fail=1
+returns_ 1 ln $t $t 2> /dev/null || fail=1
 rm $t
 
 # Make sure -sf fails when src and dest are the same
 touch $t || framework_failure_
-returns_ 1 ln -sf $t $t 2> /dev/null || fail=1
+returns_ 1 ln -f $t $t 2> /dev/null || fail=1
 rm $t
 
 # Create a symlink with source file and no explicit directory
 rm -rf $d || framework_failure_
 mkdir $d || framework_failure_
 touch $d/$f || framework_failure_
-ln -s $d/$f || fail=1
+ln $d/$f || fail=1
 test -f $f || fail=1
 rm -rf $d $f
 
@@ -80,8 +80,8 @@ rm -rf $d $f
 rm -rf $d $f $ld || framework_failure_
 touch $f || framework_failure_
 mkdir $d || framework_failure_
-ln -s $d $ld
-ln -s ../$f $ld || fail=1
+ln $d $ld
+ln ../$f $ld || fail=1
 test -f $d/$f || fail=1
 rm -rf $d $f $ld
 
@@ -90,23 +90,23 @@ rm -rf $d $f $ld
 rm -rf $d $f $ld || framework_failure_
 touch $f || framework_failure_
 mkdir $d || framework_failure_
-ln -s $d $ld
+ln $d $ld
 af=$(pwd)/$f
-ln --no-dereference -fs "$af" $ld || fail=1
+ln --no-dereference -f "$af" $ld || fail=1
 test -f $ld || fail=1
 rm -rf $d $f $ld
 
 # Try to create a symlink with backup where the destination file exists
 # and the backup file name is a hard link to the destination file.
 touch a b || framework_failure_
-ln b b~ || framework_failure_
-ln -f --b=simple a b || fail=1
+ln -h b b~ || framework_failure_
+ln -h -f --b=simple a b || fail=1
 
 # ===================================================
 
 # Make sure ln can make simple backups.
 # This was fixed in 4.0.34.  Broken in 4.0r.
-for cmd in ln cp mv ginstall; do
+for cmd in "ln -h" cp mv ginstall; do
   rm -rf a x a.orig
   touch a x || framework_failure_
   $cmd --backup=simple --suffix=.orig x a || fail=1
@@ -117,7 +117,7 @@ done
 # With coreutils-5.2.1, this would mistakenly access argv[1][-1].
 # I'm including it here, in case some day programs like valgrind detect
that.
 # Purify probably would have done so.
-ln foo '' 2> /dev/null
+ln -h foo '' 2> /dev/null
 
 # ===================================================
 
diff --git a/tests/ln/relative.sh b/tests/ln/relative.sh
index f21037005..f441199d8 100755
--- a/tests/ln/relative.sh
+++ b/tests/ln/relative.sh
@@ -23,31 +23,31 @@ mkdir -p usr/bin || framework_failure_
 mkdir -p usr/lib/foo || framework_failure_
 touch usr/lib/foo/foo || framework_failure_
 
-ln -sr usr/lib/foo/foo usr/bin/foo
+ln -r usr/lib/foo/foo usr/bin/foo
 test $(readlink usr/bin/foo) = '../lib/foo/foo' || fail=1
 
-ln -sr usr/bin/foo usr/lib/foo/link-to-foo
+ln -r usr/bin/foo usr/lib/foo/link-to-foo
 test $(readlink usr/lib/foo/link-to-foo) = 'foo' || fail=1
 
 # Correctly update an existing link, which was broken in <= 8.21
-ln -s dir1/dir2/f existing_link
-ln -srf here existing_link
+ln dir1/dir2/f existing_link
+ln -rf here existing_link
 test $(readlink existing_link) = 'here' || fail=1
 
 # Demonstrate resolved symlinks used to generate relative links
 # so here, 'web/latest' will not be linked to the intermediate 'latest'
link.
 # You'd probably want to use realpath(1) in conjunction
 # with ln(1) without --relative to give greater control.
-ln -s release1 alpha
-ln -s release2 beta
-ln -s beta latest
+ln release1 alpha
+ln release2 beta
+ln beta latest
 mkdir web
-ln -sr latest web/latest
+ln -r latest web/latest
 test $(readlink web/latest) = '../release2' || fail=1
 
 # Expect this to fail with exit status 1, or to succeed quietly (freebsd).
 # Prior to coreutils-8.23, it would segfault.
-ln -sr '' F
+ln -r '' F
 case $? in [01]) ;; *) fail=1;; esac
 
 Exit $fail
diff --git a/tests/ln/sf-1.sh b/tests/ln/sf-1.sh
index 149b27569..56a3ff111 100755
--- a/tests/ln/sf-1.sh
+++ b/tests/ln/sf-1.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Test "ln -sf".
+# Test "ln".
 
 # Copyright (C) 1997-2017 Free Software Foundation, Inc.
 
@@ -24,8 +24,8 @@ echo foo > a || framework_failure_
 # Check that a target directory of '.' is supported
 # and that indirectly specifying the same target and link name
 # through that is detected.
-ln -s . b || framework_failure_
-ln -sf a b > err 2>&1 && fail=1
+ln . b || framework_failure_
+ln -f a b > err 2>&1 && fail=1
 case $(cat err) in
   *'are the same file') ;;
   *) fail=1 ;;
@@ -36,11 +36,11 @@ esac
 name_max_plus1=$(expr $(stat -f -c %l .) + 1)
 test $name_max_plus1 -gt 1 || skip_ 'Error determining NAME_MAX'
 long_name=$(printf '%0*d' $name_max_plus1 0)
-for f in '' f; do
-  ln -s$f missing ENOENT_link || fail=1
-  ln -s$f a/b ENOTDIR_link || fail=1
-  ln -s$f ELOOP_link ELOOP_link || fail=1
-  ln -s$f "$long_name" ENAMETOOLONG_link || fail=1
+for f in '' '-f'; do
+  ln $f missing ENOENT_link || fail=1
+  ln $f a/b ENOTDIR_link || fail=1
+  ln $f ELOOP_link ELOOP_link || fail=1
+  ln $f "$long_name" ENAMETOOLONG_link || fail=1
 done
 
 Exit $fail
diff --git a/tests/ln/slash-decorated-nonexistent-dest.sh
b/tests/ln/slash-decorated-nonexistent-dest.sh
index be0650f1f..32a71d58a 100755
--- a/tests/ln/slash-decorated-nonexistent-dest.sh
+++ b/tests/ln/slash-decorated-nonexistent-dest.sh
@@ -23,7 +23,7 @@ touch f || framework_failure_
 
 
 # Before coreutils-7.6, this would succeed on Solaris 10
-returns_ 1 ln -T f no-such-file/ || fail=1
+returns_ 1 ln -h -T f no-such-file/ || fail=1
 test -e no-such-file && fail=1
 
 Exit $fail
diff --git a/tests/ln/target-1.sh b/tests/ln/target-1.sh
index 66bce3ce2..de6fc8540 100755
--- a/tests/ln/target-1.sh
+++ b/tests/ln/target-1.sh
@@ -25,6 +25,6 @@
 print_ver_ ln
 
 mkdir d || framework_failure_
-ln -s --target-dir=d ../f || fail=1
+ln --target-dir=d ../f || fail=1
 
 Exit $fail
diff --git a/tests/ls/dangle.sh b/tests/ls/dangle.sh
index ea455ffab..e16bb8773 100755
--- a/tests/ls/dangle.sh
+++ b/tests/ls/dangle.sh
@@ -22,11 +22,11 @@ print_ver_ ls
 LS_MINOR_PROBLEM=1
 LS_FAILURE=2
 
-ln -s no-such-file dangle || framework_failure_
+ln no-such-file dangle || framework_failure_
 mkdir -p dir/sub || framework_failure_
-ln -s dir slink-to-dir || framework_failure_
+ln dir slink-to-dir || framework_failure_
 mkdir d || framework_failure_
-ln -s no-such d/dangle || framework_failure_
+ln no-such d/dangle || framework_failure_
 printf '? dangle\n' > subdir_Li_exp || framework_failure_
 printf 'total 0\n? dangle\n' > subdir_Ls_exp || framework_failure_
 
diff --git a/tests/ls/file-type.sh b/tests/ls/file-type.sh
index e0bbd730c..23e7d2d0e 100755
--- a/tests/ls/file-type.sh
+++ b/tests/ls/file-type.sh
@@ -24,9 +24,9 @@ cd sub
 mkdir dir
 touch regular executable
 chmod a+x executable
-ln -s regular slink-reg
-ln -s dir slink-dir
-ln -s nowhere slink-dangle
+ln regular slink-reg
+ln dir slink-dir
+ln nowhere slink-dangle
 mknod block b 20 20 2> /dev/null && block="block
 "
 mknod char c 10 10 2> /dev/null && char="char
diff --git a/tests/ls/follow-slink.sh b/tests/ls/follow-slink.sh
index 92a503b87..47023d343 100755
--- a/tests/ls/follow-slink.sh
+++ b/tests/ls/follow-slink.sh
@@ -24,11 +24,11 @@ LS_FAILURE=2
 # Isolate output files from directory being listed
 mkdir dir dir/sub dir1 || framework_failure_
 cd dir || framework_failure_
-ln -s link link || framework_failure_
-ln -s ../../dir1 sub/link-to-dir || framework_failure_
+ln link link || framework_failure_
+ln ../../dir1 sub/link-to-dir || framework_failure_
 
 # Make sure the symlink was created.
-# 'ln -s link link' succeeds, but creates no file on
+# 'ln link link' succeeds, but creates no file on
 # systems running some DJGPP-2.03 libc.
 ls -F link > /dev/null || framework_failure_
 
diff --git a/tests/ls/infloop.sh b/tests/ls/infloop.sh
index ee2ddb8c1..cae03c7f6 100755
--- a/tests/ls/infloop.sh
+++ b/tests/ls/infloop.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 # show that the following no longer makes ls infloop
-# mkdir loop; cd loop; ln -s ../loop sub; ls -RL
+# mkdir loop; cd loop; ln ../loop sub; ls -RL
 # Also ensure ls exits with status = 2 in that case.
 # Copyright (C) 2001-2017 Free Software Foundation, Inc.
 
@@ -21,7 +21,7 @@
 print_ver_ ls
 
 mkdir loop || framework_failure_
-ln -s ../loop loop/sub || framework_failure_
+ln ../loop loop/sub || framework_failure_
 
 cat <<\EOF > exp-out || framework_failure_
 loop:
diff --git a/tests/ls/inode.sh b/tests/ls/inode.sh
index 203a92e82..99c57d694 100755
--- a/tests/ls/inode.sh
+++ b/tests/ls/inode.sh
@@ -20,7 +20,7 @@
 print_ver_ ls
 
 touch f || framework_failure_
-ln -s f slink || framework_failure_
+ln f slink || framework_failure_
 
 
 # When listed explicitly:
diff --git a/tests/ls/multihardlink.sh b/tests/ls/multihardlink.sh
index 09e3e6262..b60ca816f 100755
--- a/tests/ls/multihardlink.sh
+++ b/tests/ls/multihardlink.sh
@@ -21,7 +21,7 @@ print_ver_ ls
 working_umask_or_skip_
 
 touch file file1 || framework_failure_
-ln file1 file2 || skip_ "can't create hard link"
+ln -h file1 file2 || skip_ "can't create hard link"
 code_mh='44;37'
 code_ex='01;32'
 code_png='01;35'
diff --git a/tests/ls/no-arg.sh b/tests/ls/no-arg.sh
index ba5aaac83..87bd72016 100755
--- a/tests/ls/no-arg.sh
+++ b/tests/ls/no-arg.sh
@@ -21,7 +21,7 @@ print_ver_ ls
 
 mkdir -p dir/subdir || framework_failure_
 touch dir/subdir/file2 || framework_failure_
-ln -s f symlink || framework_failure_
+ln f symlink || framework_failure_
 
 cat > exp <<\EOF || framework_failure_
 dir
diff --git a/tests/ls/slink-acl.sh b/tests/ls/slink-acl.sh
index 7a15bec2d..d7c4e04b0 100755
--- a/tests/ls/slink-acl.sh
+++ b/tests/ls/slink-acl.sh
@@ -23,7 +23,7 @@ require_setfacl_
 
 touch k || framework_failure_
 setfacl -m user::r-- k || framework_failure_
-ln -s k s || framework_failure_
+ln k s || framework_failure_
 
 set _ $(ls -Log s); shift; link=$1
 set _ $(ls -og k);  shift; reg=$1
diff --git a/tests/ls/stat-dtype.sh b/tests/ls/stat-dtype.sh
index dbd0e31ed..f5ed840c8 100755
--- a/tests/ls/stat-dtype.sh
+++ b/tests/ls/stat-dtype.sh
@@ -34,7 +34,7 @@ if test "X$(ls -p c 2>&1)" != Xd/; then
 fi
 
 mkdir d || framework_failure_
-ln -s / d/s || framework_failure_
+ln / d/s || framework_failure_
 chmod 600 d || framework_failure_
 
 mkdir -p e/a2345 e/b || framework_failure_
diff --git a/tests/ls/stat-failed.sh b/tests/ls/stat-failed.sh
index 32f4192e5..f35507f13 100755
--- a/tests/ls/stat-failed.sh
+++ b/tests/ls/stat-failed.sh
@@ -24,7 +24,7 @@ skip_if_root_
 LS_MINOR_PROBLEM=1
 
 mkdir d || framework_failure_
-ln -s / d/s || framework_failure_
+ln / d/s || framework_failure_
 chmod 600 d || framework_failure_
 
 
diff --git a/tests/ls/stat-free-color.sh b/tests/ls/stat-free-color.sh
index 2a4c588df..6df02939a 100755
--- a/tests/ls/stat-free-color.sh
+++ b/tests/ls/stat-free-color.sh
@@ -68,9 +68,9 @@ test $n_stat1 = 0 \
 # Populate the test directory.
 mkdir d/subdir \
   && touch d/regf \
-  && ln d/regf d/hlink \
-  && ln -s regf d/slink \
-  && ln -s nowhere d/dangle \
+  && ln -h d/regf d/hlink \
+  && ln regf d/slink \
+  && ln nowhere d/dangle \
   || framework_failure_
 
 # Invocation under test.
diff --git a/tests/ls/stat-free-symlinks.sh b/tests/ls/stat-free-symlinks.sh
index 643b3373b..f88a7f747 100755
--- a/tests/ls/stat-free-symlinks.sh
+++ b/tests/ls/stat-free-symlinks.sh
@@ -22,7 +22,7 @@ require_strace_ stat
 
 touch x || framework_failure_
 chmod a+x x || framework_failure_
-ln -s x link-to-x || framework_failure_
+ln x link-to-x || framework_failure_
 
 
 # ls from coreutils 6.9 would unnecessarily stat a symlink in an
unusual case:
diff --git a/tests/ls/symlink-slash.sh b/tests/ls/symlink-slash.sh
index 87fd63e17..c6e562e5e 100755
--- a/tests/ls/symlink-slash.sh
+++ b/tests/ls/symlink-slash.sh
@@ -20,7 +20,7 @@
 print_ver_ ls
 
 mkdir dir || framework_failure_
-ln -s dir symlink || framework_failure_
+ln dir symlink || framework_failure_
 
 set $(ls -l symlink/)
 
diff --git a/tests/misc/chroot-fail.sh b/tests/misc/chroot-fail.sh
index b3fe252a4..3660a06a7 100755
--- a/tests/misc/chroot-fail.sh
+++ b/tests/misc/chroot-fail.sh
@@ -47,7 +47,7 @@ compare exp err || fail=1
 
 # Ensure we chdir("/") appropriately when NEWROOT is old "/".
 if test $can_chroot_root = 1; then
-  ln -s / isroot || framework_failure_
+  ln / isroot || framework_failure_
   for dir in '/' '/.' '/../' isroot; do
     # Verify that chroot(1) succeeds and performs chdir("/")
     # (chroot(1) of coreutils-8.23 failed to run the latter).
diff --git a/tests/misc/close-stdout.sh b/tests/misc/close-stdout.sh
index a5b900605..dd23cbf44 100755
--- a/tests/misc/close-stdout.sh
+++ b/tests/misc/close-stdout.sh
@@ -29,7 +29,7 @@ touch a
 cp a b >&- || fail=1
 test -f b || fail=1
 chmod o-w . >&- || fail=1
-ln a c >&- || fail=1
+ln -h a c >&- || fail=1
 rm c >&- || fail=1
 mkdir d >&- || fail=1
 mv d e >&- || fail=1
diff --git a/tests/misc/env.sh b/tests/misc/env.sh
index f2f6ba8df..0f2e20f99 100755
--- a/tests/misc/env.sh
+++ b/tests/misc/env.sh
@@ -111,7 +111,7 @@ export PATH
 # Avoid the issue by using a shebang to 'echo' passing a second parameter
 # before the '-i'. See the definition of simple_echo before.
 # Test -u, rather than -i, to minimize PATH problems.
-ln -s "simple_echo" ./-u || framework_failure_
+ln "simple_echo" ./-u || framework_failure_
 case $(env -u echo echo good) in
   good) ;;
   *) fail=1 ;;
@@ -127,7 +127,7 @@ esac
 
 # After options have ended, the first argument not containing = is a
program.
 returns_ 127 env a=b -- true || fail=1
-ln -s "simple_echo" ./-- || framework_failure_
+ln "simple_echo" ./-- || framework_failure_
 case $(env a=b -- true || echo fail) in
   *true) ;;
   *) fail=1 ;;
diff --git a/tests/misc/help-version.sh b/tests/misc/help-version.sh
index b864e8cc9..2073d9f29 100755
--- a/tests/misc/help-version.sh
+++ b/tests/misc/help-version.sh
@@ -222,7 +222,7 @@ link_setup () { args="$tmp_in link-target"; }
 unlink_setup () { args=$tmp_in; }
 
 readlink_setup () {
-  ln -s . slink
+  ln . slink
   args=slink;
 }
 
diff --git a/tests/misc/ls-time.sh b/tests/misc/ls-time.sh
index 5149187a1..67bdeb000 100755
--- a/tests/misc/ls-time.sh
+++ b/tests/misc/ls-time.sh
@@ -43,7 +43,7 @@ sleep 2
 touch -a -d "$u1" a || framework_failure_
 # Updating the atime is usually enough to update the ctime, but on
 # Solaris 10's tmpfs, ctime is not updated, so force an update here:
-{ ln a a-ctime && rm a-ctime; } || framework_failure_
+{ ln -h a a-ctime && rm a-ctime; } || framework_failure_
 
 
 # A has ctime more recent than C.
@@ -55,7 +55,7 @@ test "$*" = 'a c' || fail=1
 sleep 2
 
 # Create a link, updating c's ctime.
-ln c d || framework_failure_
+ln -h c d || framework_failure_
 
 # Before we go any further, verify that touch's -m option works.
 set -- $(ls --full -l a)
diff --git a/tests/misc/pwd-option.sh b/tests/misc/pwd-option.sh
index 9ba7684c0..2f071ec04 100755
--- a/tests/misc/pwd-option.sh
+++ b/tests/misc/pwd-option.sh
@@ -20,7 +20,7 @@
 print_ver_ pwd
 
 mkdir -p a/b || framework_failure_
-ln -s a/b c || framework_failure_
+ln a/b c || framework_failure_
 base=$(env -- pwd -P)
 
 # Remove any logical paths from $PWD.
diff --git a/tests/misc/readlink-fp-loop.sh b/tests/misc/readlink-fp-loop.sh
index 1f259ea69..3f4e3d549 100755
--- a/tests/misc/readlink-fp-loop.sh
+++ b/tests/misc/readlink-fp-loop.sh
@@ -25,11 +25,11 @@ cwd=$(env pwd -P)
 # two different times with no actual loop.  In addition, arrange
 # so that the second and fourth calls to readlink operate on S.
 
-ln -s s p        || framework_failure_
-ln -s d s        || framework_failure_
+ln s p        || framework_failure_
+ln d s        || framework_failure_
 mkdir d          || framework_failure_
 echo 2 > d/2     || framework_failure_
-ln -s ../s/2 d/1 || framework_failure_
+ln ../s/2 d/1 || framework_failure_
 
 # With coreutils-6.9, this would fail with ELOOP.
 readlink -v -e p/1 > out || fail=1
@@ -38,7 +38,7 @@ echo "$cwd/d/2" > exp || fail=1
 compare exp out || fail=1
 
 # Construct a real loop and make sure readlink still detects it.
-ln -sf ../s/1 d/2 || framework_failure_
+lnf ../s/1 d/2 || framework_failure_
 readlink -v -e p/1 2> out && fail=1
 readlink_msg=$(cat out)
 case $readlink_msg in
@@ -48,19 +48,19 @@ esac
 symlink_loop_msg=${readlink_msg#"readlink: p/1: "}
 
 # Exercise the hash table code.
-ln -nsf ../s/3 d/2 || framework_failure_
-ln -nsf ../p/4 d/3 || framework_failure_
-ln -nsf ../p/5 d/4 || framework_failure_
-ln -nsf ../p/6 d/5 || framework_failure_
-ln -nsf ../p/7 d/6 || framework_failure_
-ln -nsf ../p/8 d/7 || framework_failure_
+ln -nf ../s/3 d/2 || framework_failure_
+ln -nf ../p/4 d/3 || framework_failure_
+ln -nf ../p/5 d/4 || framework_failure_
+ln -nf ../p/6 d/5 || framework_failure_
+ln -nf ../p/7 d/6 || framework_failure_
+ln -nf ../p/8 d/7 || framework_failure_
 echo x > d/8       || framework_failure_
 readlink -v -e p/1 > out || fail=1
 echo "$cwd/d/8" > exp || fail=1
 compare exp out || fail=1
 
 # A trivial loop
-ln -s loop loop
+ln loop loop
 readlink -v -e loop 2> out && fail=1
 echo "readlink: loop: $symlink_loop_msg" > exp || framework_failure_
 compare exp out || fail=1
diff --git a/tests/misc/readlink-root.sh b/tests/misc/readlink-root.sh
index fe9164bf7..11600aaac 100755
--- a/tests/misc/readlink-root.sh
+++ b/tests/misc/readlink-root.sh
@@ -28,15 +28,15 @@ fi
 
 test -d /dev || framework_failure_
 
-ln -s / one || framework_failure_
-ln -s // two || framework_failure_
-ln -s /// three || framework_failure_
-ln -s /./..// one-dots || framework_failure_
-ln -s //./..// two-dots || framework_failure_
-ln -s ///./..// three-dots || framework_failure_
-ln -s /dev one-dev || framework_failure_
-ln -s //dev two-dev || framework_failure_
-ln -s ///dev three-dev || framework_failure_
+ln / one || framework_failure_
+ln // two || framework_failure_
+ln /// three || framework_failure_
+ln /./..// one-dots || framework_failure_
+ln //./..// two-dots || framework_failure_
+ln ///./..// three-dots || framework_failure_
+ln /dev one-dev || framework_failure_
+ln //dev two-dev || framework_failure_
+ln ///dev three-dev || framework_failure_
 
 cat >exp <<EOF || framework_failure_
 /
diff --git a/tests/misc/realpath.sh b/tests/misc/realpath.sh
index 7861397be..60e4d422f 100755
--- a/tests/misc/realpath.sh
+++ b/tests/misc/realpath.sh
@@ -33,11 +33,11 @@ test -d /dev || framework_failure_
 # Setup dir, file, symlink structure
 
 mkdir -p dir1/dir2 || framework_failure_
-ln -s dir1/dir2 ldir2 || framework_failure_
+ln dir1/dir2 ldir2 || framework_failure_
 touch dir1/f dir1/dir2/f || framework_failure_
-ln -s / one || framework_failure_
-ln -s // two || framework_failure_
-ln -s /// three || framework_failure_
+ln / one || framework_failure_
+ln // two || framework_failure_
+ln /// three || framework_failure_
 
 # Basic operation
 realpath -Pqz . >/dev/null || fail=1
diff --git a/tests/misc/stat-slash.sh b/tests/misc/stat-slash.sh
index a86aac794..3e8480255 100755
--- a/tests/misc/stat-slash.sh
+++ b/tests/misc/stat-slash.sh
@@ -21,8 +21,8 @@ print_ver_ stat
 
 touch file || framework_failure_
 mkdir dir || framework_failure_
-ln -s file link1 || framework_failure_
-ln -s dir link2 || framework_failure_
+ln file link1 || framework_failure_
+ln dir link2 || framework_failure_
 
 cat <<EOF > exp || framework_failure_
 link1
diff --git a/tests/misc/truncate-dangling-symlink.sh
b/tests/misc/truncate-dangling-symlink.sh
index 0e18f3d4f..3e2f7d998 100755
--- a/tests/misc/truncate-dangling-symlink.sh
+++ b/tests/misc/truncate-dangling-symlink.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ truncate
 
-ln -s truncate-target t-symlink
+ln truncate-target t-symlink
 
 truncate -s0 t-symlink || fail=1
 
diff --git a/tests/mkdir/p-thru-slink.sh b/tests/mkdir/p-thru-slink.sh
index cbe867c6d..86c9c178b 100755
--- a/tests/mkdir/p-thru-slink.sh
+++ b/tests/mkdir/p-thru-slink.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ mkdir
 
-ln -s . slink || framework_failure_
+ln . slink || framework_failure_
 
 mkdir -p slink/x || fail=1
 test -d x || fail=1
diff --git a/tests/mv/atomic.sh b/tests/mv/atomic.sh
index f83db76be..cb4313311 100755
--- a/tests/mv/atomic.sh
+++ b/tests/mv/atomic.sh
@@ -21,17 +21,17 @@ print_ver_ mv
 require_strace_ unlink
 
 # Before the fix, mv would unnecessarily unlink the destination symlink:
-#   $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2
+#   $ rm -rf s[12]; ln / s1; ln -s /tmp s2
 #   $ strace -qe unlink /bin/mv -T s1 s2
 #   unlink("s2") = 0
 #
 # With the fix, it doesn't call unlink:
-#   $ rm -rf s[12]; ln -s / s1; ln -s /tmp s2
+#   $ rm -rf s[12]; ln / s1; ln -s /tmp s2
 #   $ strace -qe unlink ./mv -T s1 s2
 #   $
 
-ln -s t1 s1 || framework_failure_
-ln -s t2 s2 || framework_failure_
+ln t1 s1 || framework_failure_
+ln t2 s2 || framework_failure_
 
 
 strace -qe unlink mv -T s1 s2 > out 2>&1 || fail=1
diff --git a/tests/mv/atomic2.sh b/tests/mv/atomic2.sh
index 679981679..c6266fcfb 100755
--- a/tests/mv/atomic2.sh
+++ b/tests/mv/atomic2.sh
@@ -29,7 +29,7 @@ require_strace_ unlink
 #   $
 
 touch a b || framework_failure_
-ln b b2 || framework_failure_
+ln -h b b2 || framework_failure_
 
 
 strace -qe unlink mv a b > out 2>&1 || fail=1
diff --git a/tests/mv/childproof.sh b/tests/mv/childproof.sh
index 9f9e19853..98e5689e4 100755
--- a/tests/mv/childproof.sh
+++ b/tests/mv/childproof.sh
@@ -54,7 +54,7 @@ test "$(cat c/f)" = a || fail=1
 # we save file names in addition to dev/ino.
 rm -f c/f* b/f
 touch a/f
-ln a/f b/g
+ln -h a/f b/g
 mv a/f b/g c || fail=1
 test -f a/f && fail=1
 test -f b/g && fail=1
@@ -74,7 +74,7 @@ test -f c/g || fail=1
 rm -f a/f b/f c/f
 echo a > a/f || fail=1
 echo b > b/f || fail=1
-returns_ 1 ln -f a/f b/f c 2> /dev/null || fail=1
+returns_ 1 ln -h -f a/f b/f c 2> /dev/null || fail=1
 # a/f and c/f must be linked
 test $(stat --format %i a/f) = $(stat --format %i c/f) || fail=1
 # b/f and c/f must not be linked
diff --git a/tests/mv/force.sh b/tests/mv/force.sh
index c53d71db9..377332886 100755
--- a/tests/mv/force.sh
+++ b/tests/mv/force.sh
@@ -23,7 +23,7 @@ ff=mvforce
 ff2=mvforce2
 
 echo force-contents > $ff || framework_failure_
-ln $ff $ff2 || framework_failure_
+ln -h $ff $ff2 || framework_failure_
 
 # mv should fail for the same name, or separate hardlinks as in
 # both cases rename() will do nothing and return success.
diff --git a/tests/mv/hard-2.sh b/tests/mv/hard-2.sh
index 028b80476..a964beef6 100755
--- a/tests/mv/hard-2.sh
+++ b/tests/mv/hard-2.sh
@@ -25,8 +25,8 @@ skip_if_root_
 mkdir dst || framework_failure_
 (cd dst && touch a b c) || framework_failure_
 touch a || framework_failure_
-ln a b || framework_failure_
-ln a c || framework_failure_
+ln -h a b || framework_failure_
+ln -h a c || framework_failure_
 
 
 # ======================================
diff --git a/tests/mv/hard-3.sh b/tests/mv/hard-3.sh
index 8386dbab2..04ecd6f2b 100755
--- a/tests/mv/hard-3.sh
+++ b/tests/mv/hard-3.sh
@@ -38,8 +38,8 @@ mkdir -p x dst/x || framework_failure_
 touch dst/x/b || framework_failure_
 chmod a-w dst/x
 touch a || framework_failure_
-ln a x/b || framework_failure_
-ln a c || framework_failure_
+ln -h a x/b || framework_failure_
+ln -h a c || framework_failure_
 
 
 # ======================================
diff --git a/tests/mv/hard-4.sh b/tests/mv/hard-4.sh
index 9d4196a02..cea408286 100755
--- a/tests/mv/hard-4.sh
+++ b/tests/mv/hard-4.sh
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ mv
 touch a || framework_failure_
-ln a b || framework_failure_
+ln -h a b || framework_failure_
 
 # Between coreutils-5.0 and coreutils-8.24, 'a' would be removed.
 # Before coreutils-5.0.1 the issue would not have been diagnosed.
diff --git a/tests/mv/hard-link-1.sh b/tests/mv/hard-link-1.sh
index 9ef711bcf..3ffbfc4c3 100755
--- a/tests/mv/hard-link-1.sh
+++ b/tests/mv/hard-link-1.sh
@@ -26,7 +26,7 @@ dir=hlink
 
 mkdir $dir || framework_failure_
 > $dir/a || framework_failure_
-ln $dir/a $dir/b || framework_failure_
+ln -h $dir/a $dir/b || framework_failure_
 
 mv $dir "$other_partition_tmpdir" || fail=1
 
diff --git a/tests/mv/hardlink-case.sh b/tests/mv/hardlink-case.sh
index 78e684e9b..08aed81f2 100755
--- a/tests/mv/hardlink-case.sh
+++ b/tests/mv/hardlink-case.sh
@@ -30,7 +30,7 @@ mount hfs.img mnt       || skip_ 'failed to mount hfs
file system'
 
 cd mnt
 touch foo
-ln foo whatever
+ln -h foo whatever
 returns_ 1 mv foo Foo || fail=1
 test -r foo || fail=1
 
diff --git a/tests/mv/i-4.sh b/tests/mv/i-4.sh
index b09054897..29fbd2b25 100755
--- a/tests/mv/i-4.sh
+++ b/tests/mv/i-4.sh
@@ -37,7 +37,7 @@ esac
 # when a and b are hard links to the same file.
 rm -f a b
 echo a > a
-ln a b
+ln -h a b
 mv -i a b < y 2>err && fail=1
 test -r a || fail=1
 test -r b || fail=1
diff --git a/tests/mv/i-link-no.sh b/tests/mv/i-link-no.sh
index 16a3a9e33..da6d5a21f 100755
--- a/tests/mv/i-link-no.sh
+++ b/tests/mv/i-link-no.sh
@@ -21,9 +21,9 @@ print_ver_ mv
 
 mkdir a b || framework_failure_
 echo foo > a/foo || framework_failure_
-ln a/foo a/bar || framework_failure_
+ln -h a/foo a/bar || framework_failure_
 echo FUBAR > b/FUBAR || framework_failure_
-ln b/FUBAR b/bar || framework_failure_
+ln -h b/FUBAR b/bar || framework_failure_
 chmod a-w b/bar || framework_failure_
 echo n > no || framework_failure_
 
diff --git a/tests/mv/into-self-2.sh b/tests/mv/into-self-2.sh
index 14d996029..8d9713d4b 100755
--- a/tests/mv/into-self-2.sh
+++ b/tests/mv/into-self-2.sh
@@ -28,7 +28,7 @@ symlink=symlink
 
 
 echo whatever > $file || framework_failure_
-ln -s $file $symlink || framework_failure_
+ln $file $symlink || framework_failure_
 
 # This mv command should exit nonzero.
 mv $symlink $file > out 2>&1 && fail=1
diff --git a/tests/mv/into-self-4.sh b/tests/mv/into-self-4.sh
index 695fd633c..42e0953ee 100755
--- a/tests/mv/into-self-4.sh
+++ b/tests/mv/into-self-4.sh
@@ -21,7 +21,7 @@
 print_ver_ mv
 
 touch file || framework_failure_
-ln -s file s || framework_failure_
+ln file s || framework_failure_
 
 
 # This must fail.
diff --git a/tests/mv/part-hardlink.sh b/tests/mv/part-hardlink.sh
index 064562c09..babd06235 100755
--- a/tests/mv/part-hardlink.sh
+++ b/tests/mv/part-hardlink.sh
@@ -25,10 +25,10 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_srcdir/tests/other-fs-tmpdir"
 
 touch f || framework_failure_
-ln f g || framework_failure_
+ln -h f g || framework_failure_
 mkdir a b || framework_failure_
 touch a/1 || framework_failure_
-ln a/1 b/1 || framework_failure_
+ln -h a/1 b/1 || framework_failure_
 
 
 mv f g "$other_partition_tmpdir" || fail=1
diff --git a/tests/mv/part-symlink.sh b/tests/mv/part-symlink.sh
index efeadd067..c8693969d 100755
--- a/tests/mv/part-symlink.sh
+++ b/tests/mv/part-symlink.sh
@@ -74,7 +74,7 @@ for copy in cp mv; do
       case "$args" in *rem_sl*) slink=$rem_sl ;; esac
 
       echo $contents > "$reg_abs" || fail=1
-      ln -nsf "$reg_abs" $slink || fail=1
+      ln -nf "$reg_abs" $slink || fail=1
       actual_args=$(echo $args|sed 's,^,$,;s/ / $/')
       actual_args=$(eval echo $actual_args)
 
diff --git a/tests/mv/symlink-onto-hardlink-to-self.sh
b/tests/mv/symlink-onto-hardlink-to-self.sh
index 4d56febc8..ba5f76b96 100755
--- a/tests/mv/symlink-onto-hardlink-to-self.sh
+++ b/tests/mv/symlink-onto-hardlink-to-self.sh
@@ -24,11 +24,11 @@ print_ver_ mv
 
 # Create a file f, and a symlink s1 to that file.
 touch f || framework_failure_
-ln -s f s2 || framework_failure_
+ln f s2 || framework_failure_
 
 # Attempt to create a hard link to that symlink.
 # On some systems, it's not possible: they create a hard link to the
referent.
-ln s2 s1 || framework_failure_
+ln -h s2 s1 || framework_failure_
 
 # If s1 is not a symlink, skip this test.
 test -h s1 \
diff --git a/tests/mv/symlink-onto-hardlink.sh
b/tests/mv/symlink-onto-hardlink.sh
index ce26ebd07..64064f14a 100755
--- a/tests/mv/symlink-onto-hardlink.sh
+++ b/tests/mv/symlink-onto-hardlink.sh
@@ -20,8 +20,8 @@
 print_ver_ mv
 
 touch f || framework_failure_
-ln f h || framework_failure_
-ln -s f s || framework_failure_
+ln -h f h || framework_failure_
+ln f s || framework_failure_
 
 # Given two links f and h to some important content, and a symlink s to f,
 # "mv s f" must fail because it might then be hard to find the link, h.
diff --git a/tests/mv/to-symlink.sh b/tests/mv/to-symlink.sh
index 8349b1290..b89d81e60 100755
--- a/tests/mv/to-symlink.sh
+++ b/tests/mv/to-symlink.sh
@@ -28,7 +28,7 @@ file=to-sym
 
 echo local > $file || framework_failure_
 echo remote > $rem_file || framework_failure_
-ln -s $rem_file $rem_symlink || framework_failure_
+ln $rem_file $rem_symlink || framework_failure_
 
 # This mv command should succeed, unlinking the symlink
 # before copying.
diff --git a/tests/readlink/can-e.sh b/tests/readlink/can-e.sh
index 38fd76398..b4d6ad000 100755
--- a/tests/readlink/can-e.sh
+++ b/tests/readlink/can-e.sh
@@ -29,10 +29,10 @@ cd $tmp || framework_failure_
 mkdir subdir removed || framework_failure_
 touch regfile || framework_failure_
 
-ln -s regfile link1 || framework_failure_
-ln -s subdir link2 || framework_failure_
-ln -s missing link3 || framework_failure_
-ln -s subdir/missing link4 || framework_failure_
+ln regfile link1 || framework_failure_
+ln subdir link2 || framework_failure_
+ln missing link3 || framework_failure_
+ln subdir/missing link4 || framework_failure_
 
 cd "$pwd/$tmp/removed" || framework_failure_
 
diff --git a/tests/readlink/can-f.sh b/tests/readlink/can-f.sh
index 944d54506..8fb942bd1 100755
--- a/tests/readlink/can-f.sh
+++ b/tests/readlink/can-f.sh
@@ -29,11 +29,11 @@ cd $tmp || framework_failure_
 mkdir subdir removed || framework_failure_
 touch regfile || framework_failure_
 
-ln -s regfile link1 || framework_failure_
-ln -s subdir link2 || framework_failure_
-ln -s missing link3 || framework_failure_
-ln -s subdir/missing link4 || framework_failure_
-ln -s link5 link5 || framework_failure_
+ln regfile link1 || framework_failure_
+ln subdir link2 || framework_failure_
+ln missing link3 || framework_failure_
+ln subdir/missing link4 || framework_failure_
+ln link5 link5 || framework_failure_
 
 cd "$pwd/$tmp/removed" || framework_failure_
 
diff --git a/tests/readlink/can-m.sh b/tests/readlink/can-m.sh
index a9e10b55c..a7e52f087 100755
--- a/tests/readlink/can-m.sh
+++ b/tests/readlink/can-m.sh
@@ -29,10 +29,10 @@ cd $tmp || framework_failure_
 mkdir subdir removed || framework_failure_
 touch regfile || framework_failure_
 
-ln -s regfile link1 || framework_failure_
-ln -s subdir link2 || framework_failure_
-ln -s missing link3 || framework_failure_
-ln -s subdir/missing link4 || framework_failure_
+ln regfile link1 || framework_failure_
+ln subdir link2 || framework_failure_
+ln missing link3 || framework_failure_
+ln subdir/missing link4 || framework_failure_
 
 cd "$pwd/$tmp/removed" || framework_failure_
 
diff --git a/tests/readlink/multi.sh b/tests/readlink/multi.sh
index 5dc57fab5..c986f5337 100755
--- a/tests/readlink/multi.sh
+++ b/tests/readlink/multi.sh
@@ -20,7 +20,7 @@
 print_ver_ readlink
 
 touch regfile || framework_failure_
-ln -s regfile link1 || framework_failure_
+ln regfile link1 || framework_failure_
 
 readlink link1 link1 || fail=1
 returns_ 1 readlink link1 link2 || fail=1
diff --git a/tests/readlink/rl-1.sh b/tests/readlink/rl-1.sh
index 5318a5022..3cbfc381c 100755
--- a/tests/readlink/rl-1.sh
+++ b/tests/readlink/rl-1.sh
@@ -21,8 +21,8 @@ print_ver_ readlink
 
 mkdir subdir || framework_failure_
 touch regfile || framework_failure_
-ln -s regfile link1 || framework_failure_
-ln -s missing link2 || framework_failure_
+ln regfile link1 || framework_failure_
+ln missing link2 || framework_failure_
 
 
 v=$(readlink link1) || fail=1
diff --git a/tests/rm/dangling-symlink.sh b/tests/rm/dangling-symlink.sh
index bf47f79fd..83228616e 100755
--- a/tests/rm/dangling-symlink.sh
+++ b/tests/rm/dangling-symlink.sh
@@ -22,8 +22,8 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ rm
 
-ln -s no-file dangle
-ln -s / symlink
+ln no-file dangle
+ln / symlink
 
 # Terminate any background processes
 cleanup_() { kill $pid 2>/dev/null && wait $pid; }
diff --git a/tests/rm/fail-eacces.sh b/tests/rm/fail-eacces.sh
index fdbf7094a..4b2833fb9 100755
--- a/tests/rm/fail-eacces.sh
+++ b/tests/rm/fail-eacces.sh
@@ -26,13 +26,13 @@ skip_if_root_
 ok=0
 mkdir d           &&
   touch d/f       &&
-  ln -s f d/slink &&
+  ln f d/slink &&
   chmod a-w d     &&
   ok=1
 test $ok = 1 || framework_failure_
 
 mkdir e           &&
-  ln -s f e/slink &&
+  ln f e/slink &&
   chmod a-w e     &&
   ok=1
 test $ok = 1 || framework_failure_
diff --git a/tests/rm/r-root.sh b/tests/rm/r-root.sh
index 7cf3a3f3d..76b989afa 100755
--- a/tests/rm/r-root.sh
+++ b/tests/rm/r-root.sh
@@ -183,9 +183,9 @@ EOD
 # Exercise various synonyms of "/" including symlinks to it.
 # Expect a non-Zero exit status.
 # Prepare a few symlinks to "/".
-ln -s /        rootlink  || framework_failure_
-ln -s rootlink rootlink2 || framework_failure_
-ln -sr /       rootlink3 || framework_failure_
+ln /        rootlink  || framework_failure_
+ln rootlink rootlink2 || framework_failure_
+lnr /       rootlink3 || framework_failure_
 
 for opts in           \
   '/'                 \
diff --git a/tests/rm/rm3.sh b/tests/rm/rm3.sh
index 5f29e4471..e37228943 100755
--- a/tests/rm/rm3.sh
+++ b/tests/rm/rm3.sh
@@ -24,8 +24,8 @@ mkdir -p z || framework_failure_
 cd z || framework_failure_
 touch empty empty-u || framework_failure_
 echo not-empty > fu
-ln -s empty-f slink
-ln -s . slinkdot
+ln empty-f slink
+ln . slinkdot
 mkdir d du || framework_failure_
 chmod u-w fu du empty-u || framework_failure_
 cd ..
diff --git a/tests/split/guard-input.sh b/tests/split/guard-input.sh
index 32ce394ea..4b146d8ef 100755
--- a/tests/split/guard-input.sh
+++ b/tests/split/guard-input.sh
@@ -20,8 +20,8 @@
 print_ver_ split
 
 seq 10 | tee exp-1 > xaa
-ln -s xaa in2
-ln xaa in3
+ln xaa in2
+ln -h xaa in3
 
 returns_ 1 split -C 6 xaa || fail=1
 returns_ 1 split -C 6 in2 || fail=1
diff --git a/tests/tail-2/symlink.sh b/tests/tail-2/symlink.sh
index e3a9a60b7..610bb7d5c 100755
--- a/tests/tail-2/symlink.sh
+++ b/tests/tail-2/symlink.sh
@@ -46,7 +46,7 @@ fastpoll='-s.1 --max-unchanged-stats=1'
 # Prior to v8.22, inotify would fail to recognize changes in the targets.
 # Clear 'out' so that we can check its contents without races.
 >out                            || framework_failure_
-ln -nsf target symlink          || framework_failure_
+ln -nf target symlink          || framework_failure_
 timeout 10 tail $fastpoll -F symlink >out 2>&1 & pid=$!
 # Wait for "cannot open..."
 retry_delay_ wait4lines_ .1 6 1 || { cat out; fail=1; }
@@ -66,11 +66,11 @@ rm -f target out           || framework_failure_
 # Clear 'out' so that we can check its contents without races.
 >out                            || framework_failure_
 echo "X1" > target1             || framework_failure_
-ln -nsf target1 symlink         || framework_failure_
+ln -nf target1 symlink         || framework_failure_
 timeout 10 tail $fastpoll -F symlink >out 2>&1 & pid=$!
 # Wait for the expected output.
 retry_delay_ wait4lines_ .1 6 1 || { cat out; fail=1; }
-ln -nsf target2 symlink         || framework_failure_
+ln -nf target2 symlink         || framework_failure_
 # Wait for "become inaccess..."
 retry_delay_ wait4lines_ .1 6 2 || { cat out; fail=1; }
 echo "X2" > target2             || framework_failure_
diff --git a/tests/touch/dangling-symlink.sh
b/tests/touch/dangling-symlink.sh
index 32525fd77..a78cab302 100755
--- a/tests/touch/dangling-symlink.sh
+++ b/tests/touch/dangling-symlink.sh
@@ -21,7 +21,7 @@
 print_ver_ touch
 
 rm -f touch-target t-symlink
-ln -s touch-target t-symlink
+ln touch-target t-symlink
 
 # This used to infloop.
 touch t-symlink || fail=1
diff --git a/tests/touch/no-dereference.sh b/tests/touch/no-dereference.sh
index 29fbc510e..ff9a44454 100755
--- a/tests/touch/no-dereference.sh
+++ b/tests/touch/no-dereference.sh
@@ -19,9 +19,9 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ touch test
 
-ln -s nowhere dangling || framework_failure_
+ln nowhere dangling || framework_failure_
 touch file || framework_failure_
-ln -s file link || framework_failure_
+ln file link || framework_failure_
 
 
 # These first tests should work on every platform.
diff --git a/tests/touch/trailing-slash.sh b/tests/touch/trailing-slash.sh
index 8ab8a3924..c31efa2f5 100755
--- a/tests/touch/trailing-slash.sh
+++ b/tests/touch/trailing-slash.sh
@@ -19,12 +19,12 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ touch
 
-ln -s nowhere dangling || framework_failure_
-ln -s loop loop || framework_failure_
+ln nowhere dangling || framework_failure_
+ln loop loop || framework_failure_
 touch file || framework_failure_
-ln -s file link1 || framework_failure_
+ln file link1 || framework_failure_
 mkdir dir || framework_failure_
-ln -s dir link2 || framework_failure_
+ln dir link2 || framework_failure_
 
 
 # Trailing slash can only appear on directory or symlink-to-directory.
-- 
2.11.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]