I found a link file "gap" in my ~/bin folder, must have been placed there by some installation process (I never used the ln command myself). I wanted to upgrade from gap-4.10.2 to gap-4.11.0, so I opened the link file using
vim gap
but it opened in read-only mode, so I opened it with
sudo vim gap
and then I could change it with insert mode.
I just edited the content of the link file from
#!/bin/sh
GAP_EXE=$GAP_DIR
if [ "x$GAP_DIR" = "x" ]; then
GAP_DIR=$(cd "/home/user/gap-4.10.2" && pwd)
GAP_EXE=/home/user/gap-4.10.2
fi
exec "$GAP_EXE/gap" -l "$GAP_DIR;/home/user/.gap" "$@"
by replacing both numbers by 4.11.0 respectively (a path that already existed), so that it looked like
#!/bin/sh
GAP_EXE=$GAP_DIR
if [ "x$GAP_DIR" = "x" ]; then
GAP_DIR=$(cd "/home/user/gap-4.11.0" && pwd)
GAP_EXE=/home/user/gap-4.11.0
fi
exec "$GAP_EXE/gap" -l "$GAP_DIR;/home/user/.gap" "$@"
Then save&exit with
:wq
So, YES, you CAN edit a link file.
One problem still remains: in /bin with
ls -l
the name is still
gap -> ../gap-4.10.2/bin/gap.sh
so the long name of the link file still has the old path in it, but it points to the new path. Is there any way to change that identifyer? Not that it's really bothering me. The link works fine now.