-1

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?

voretaq7
  • 79,879
  • 17
  • 130
  • 214
Isius
  • 284
  • 1
  • 4
  • 15
  • 3
    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
    http://symbolhound.com 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
  • 2
    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
  • @Isius It doesn't come with a man page? (I actually wouldn't be surprised if it didn't these days...) – voretaq7 Apr 11 '12 at 15:36

1 Answers1

1

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 :-)

voretaq7
  • 79,879
  • 17
  • 130
  • 214