logo separator

[mkgmap-dev] --bounds not accepting ~ (tilde)

From Marko Mäkelä marko.makela at iki.fi on Fri Feb 15 07:46:48 GMT 2013

On Thu, Feb 14, 2013 at 10:46:14PM -0800, GerdP wrote:
>I am not convinced that it's worth all the work.

Me neither. I would just leave it as is. It is not that hard to write 
"$HOME" or $HOME instead of ~ if you need it. Instead of typing the 
commands interactively on the command line, you could write it in a 
shell script (or .bat file for cmd.exe users) and invoke the script.

>>> man 1 bash says:
>>>> Tilde Expansion
>>>> If a word begins with an unquoted tilde character (`~'), all of the 
>>>> characters preceding the first unquoted slash (or all characters, 
>>>> if there  is no unquoted slash) are considered a tilde-prefix.
>>>
>>> Note the 'begins with'.
>>
>> that's different. that part refers to tilde prefix being ~
>> <username>

Not really. I omitted the rest of the paragraph, which included this 
sentence:

>If this login name is the null string, the tilde is replaced  with  the 
>value  of  the shell parameter HOME.

>>that's not bash specific - it is a unix-specific concept, and it is 
>>the current user's home directory. it would be really nice if it was 
>>also supported in scenarios like --bounds=~/user/bounds

The Unix principle is a loose bunch of simple tools, not duplicating 
each others' functionality. It is not the job of applications to do 
stuff like tilde expansion or glob pattern expansion. It is the task of 
the command line shell. (This may be a bit different in the Microsoft 
world, as the MS-DOS command.com does not expand glob patterns.)

If mkgmap implemented this, what would be next? Brace expansion?
http://rgeissert.blogspot.com/2013/01/a-bashism-week-brace-expansion.html

For what it is worth, I am a *nix user since 21 years, and my main 
computing platform has been GNU/Linux (with the Bourne again shell) for 
about 20 years now.

Best regards,

	Marko


More information about the mkgmap-dev mailing list