如果我创建一个指向(不存在的)目标的符号链接,old
。
ln -sf "old" /tmp/symlink
然后运行以下Makefile:
SHELL := /bin/bash
all:
@ln -sf "new" /tmp/symlink
@ls -l /tmp/symlink
@echo "$(shell ls -l /tmp/symlink)"
它为符号链接输出两个不同的目标:
lrwxrwxrwx ... /tmp/symlink -> new
lrwxrwxrwx ... /tmp/symlink -> old
为什么shell
命令会返回符号链接的过期目标?