Server Fault is a question and answer site for system and network administrators. 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

In my mt-daapd config file is the line

name = %h

which, if I understand correctly, when my hostname is aCoolHostname this will evaluate to

name = acoolhostname

in lowercase.

How do I use the %h but keep the lovely case formatting?

share|improve this question

closed as not a real question by mdpc, EEAA, Scott Pack, Ward, rnxrx Aug 23 '12 at 16:52

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

In what config file for what program? There are no standards for such escape sequences; it's up to the program that processes it. – geekosaur Apr 10 '12 at 21:29
this particular config is for mt-daapd. But I thought this was a shell thing. It's so difficult to search Google for %h. – Isius Apr 10 '12 at 21:31
2 may work better for symbol searches, but no, shells don't typically expand such escapes except within their own scripts (not random configuration files for other programs); and %h in the shell would look for a job name starting with h, not a hostname. – geekosaur Apr 10 '12 at 21:41
Searching Google for %h is like asking the doctor to tell you why your arm hurts. While you're in New York, USA and the doctor is in Sidney, Australia. The documentation for the mt-daapd configuration file would be a better place to start :-) – voretaq7 Apr 10 '12 at 21:43
Ha, I'd love to find the documentation. Looked for it first. Still looking. – Isius Apr 10 '12 at 21:56
up vote 1 down vote accepted

Consult the documentation for mt-daapd -- being unable to find any after a quick Google search, my best-guess inclination is that %h expands to the local system's hostname, and hostnames are case-insensitive (RFC 952, RFC 1123).

The internet has no respect for your "lovely" capitalization, so the software sees no reason to preserve it. If my guess is correct the only way to preserve it would be to manually specify the hostname (with the capitalization you want) instead of using the expansion macro %h, and this does not guarantee that the software wouldn't just throw away the capitalization again, as it's meaningless in the context of hostnames.
Bottom line: you probably want to get used to seeing your hostname in lower case :-)

share|improve this answer
He probably has a domain name like, or and wants to make sure no one misunderstands :) – cjc Apr 10 '12 at 21:53
@cjc, don't forget about – glenn jackman Apr 10 '12 at 22:23
@glennjackman I'm not touching that one :-) – voretaq7 Apr 11 '12 at 15:27

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