Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
What do you mean by "write extended attributes to a file"? What is "jwodder"? – Daniel Beck May 8 '11 at 2:46
@Daniel Beck, 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 is another, then there is Matt Lye, and there are probably more. I don't know who is responsible for the version that comes installed with OSX. – timoto May 9 '11 at 12:22
up vote 1 down vote accepted

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.

share|improve this answer
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 '11 at 11:21

You must log in to answer this question.

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