I was trying to find all symbolic links in /usr/lib and use file on the first entry in the list, which I delimited with head -n 1.

Why does find /usr/lib -maxdepth 1 -type l | file $(head -n 1) work but find /usr/lib -maxdepth 1 -type l | head -n 1 | file does not?

It complains that I am not using file correctly. Probably because it lacks an argument, but - programmatically/syntactically - why can’t file grab it’s argument from the pipe?

  • N0x0n@lemmy.ml
    link
    fedilink
    arrow-up
    2
    ·
    4 hours ago

    Thanks for the clarification :)) still new the all the bash syntax and always interested to hear what more skilled people have to say !