Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 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 '11 at 12:22
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.