On OSX you can have tags which allows you to identify different categories of files. Here are two text files with different tags when viewed in Finder:
I have a large number of these files and have written a bash script to make several edits on these files. So, for instance I do:
$ sed 's/old text/new text/' file1.txt > /tmp/foo.txt $ cp -p /tmp/foo.txt file1.txt
in which case I get the desired file content but loose the tags:
Question: How do I copy the tags from the original file to the edited file?