0

When using xattr at the command line, is it possible to enter a line break at the end of the name:value pair somehow ?

I noticed that when listing the extended attributes of a file:

xattr -l file

The attributes are listed with a line break between each one, making it a lot easier to read them.

However when I write extended attributes to a file and then list them, they are bunched one line after the next.

2
  • What do you mean by "write extended attributes to a file"? What is "jwodder"?
    – Daniel Beck
    May 8, 2011 at 2:46
  • @Daniel Beck, Extended File Attributes en.wikipedia.org/wiki/Extended_file_attributes Xattr is the name of several applications that do similar but different tasks so it can be rather confusing to differentiate. I put the name (jwodder) there because that is one developer responsible for one of the xattr applications, Bob Ippolito pypi.python.org/pypi/xattr is another, then there is Matt Lye sourceforge.net/projects/xattr, and there are probably more. I don't know who is responsible for the version that comes installed with OSX.
    – timoto
    May 9, 2011 at 12:22

1 Answer 1

1

If by "a line break [between each one]" you mean "a blank line," that blank line is only inserted between different files' attribute listings; a list of attributes for a single file does not separate them with blanks. If you want a blank line after every attribute, the only way to do this would be to patch xattr and recompile.

1
  • I wasn't expecting to receive an answer from the coder, but thank you very much for your application and the patched version. I will certainly follow that link.
    – timoto
    May 9, 2011 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .