make`hell`命令返回过时的符号链接目标

时间:2015-05-07 11:12:48

标签: bash shell makefile symlink

如果我创建一个指向(不存在的)目标的符号链接,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命令会返回符号链接的过期目标?

0 个答案:

没有答案