I'm having a hard time figuring how to pass the output of one command to another as an argument.
Specificly, I want to pass the list the extended attributes of a file in FreeBSD, with lsextattr, and pass its output to rmextattr to remove all the extended attributes. Yes, I need to do this because rmextattr don't have a recursive option...
I'm trying something like this without luck:
# lsextattr -q user some_file.txt | rmextattr user "$1" some_file.txt rmextattr: some_file.txt: failed: Attribute not found
I think lsextattr is working correctly, but can't pass its output to rmextattr correctly!!
# lsextattr -q user some_file.txt DosStream.com.apple.lastuseddate#PS:$DATA DosStream.AFP_AfpInfo:$DATA