Bryce Nesbitt a écrit : > Here is try two at the end of line comment script for /etc/aliases. Can > anyone do this more elegantly? > > #!/bin/sh > # Created so we can have end of line comments in /etc/aliases > sed 's/#.*$//;/^$/d' < /etc/aliases > /tmp/aliases_tmp ; > /usr/sbin/sendmail -bi -oA/tmp/aliases_tmp ; mv /tmp/aliases_tmp.db > /etc/aliases.db > > Wietse wrote the cryptic note "All the supported features are in the > DOCUMENTATION.". But I have a different question: is this as elegant as > it gets? Is there a more clever solution using the DOCUMENTATION > features that is available? Will the moving of the aliases.db cause > other problems with postfix or postalias?
you are fighting against the system. and usually at least, the system wins and you lose. there is no reason to prefer: joe jim # blah blah to # blah blah joe jim or we could want joe (blah blah) jim (blah blah) or blah <joe> blah blah <jim> blah so yes, you can play a lot of shell games to support any format you want. you can even support an xml format (well, this would be hard with the shell...) if you like that. The only thing that counts here is that your script generates a file that conforms with postfix specs. note that for those of us who use an rdbms, this is a non-question.