I want to get from any Unix-like system (if this is possible) a unique id that will be persistent every time my application runs in the same machine. If it is possible, I wa
You don't mention how stable the unique identifier needs to be -- do you always want the same host to produce the same ID each time your code is run?
If no, then fuzzymonk's suggestion of uuidgen is what you want.
If yes, then you need to decide what constitutes "same" as far as the host as concerned. One way would be as you suggest, the MD5 sum of the MAC of the first ethernet interface and "something". For "something" in that case I would consider the FQDN, unless your notion of "same host" includes the FQDN changing...