The following command:
echo ./test/test2/test23 | xargs -I "{}" echo `dirname "{}"`
Outputs: .
(not as expected)
The following command:
echo ./test/test2/test23 | xargs -I "{}" echo `dirname ./test/test2/test23`
Outputs: ./test/test2
(as expected)
The following command:
echo ./test/test2/test23 | xargs -I "{}" echo `echo "{}"`
Outputs: ./test/test2/test23
(as expected)
Why is the first command not outputting ./test/test2
?