I'm not going to call this solved, but I at least have a working solution -- and analysis (follows). Here's my weak (very weak) unix-fu understanding of the problem. The Preview function of the MMD bundle has three simple lines:
cd "${TM_MULTIMARKDOWN_PATH:-~/Library/Application Support/
MultiMarkdown}"
cd bin ./multimarkdown2XHTML.pl
After upgrading to Leopard, I was getting the following error report:
/bin/bash: line 2: cd: ~/Library/Application Support/MultiMarkdown:
No such file or directory
/bin/bash: line 3: cd: bin: No such file or directory /bin/bash: line 4: ./multimarkdown2XHTML.pl: No such file or
directory
Because my unix-fu is so very, very (very) weak, it took me the longest time to realize that the Bash shell wasn't seeing the directory. I tested it by running
cd "~/Library/Application Support/MultiMarkdown"
No such file or directory
I tried changing it to the more usual:
cd ~/Library/Application\ Support/MultiMarkdown
Presto! It worked. I changed the first line in the MMD Preview to the above and Preview now works like it used to.
Now you can all stop chuckling at how slow I am, but my question is: has anyone else encountered this problem? Surely I'm not the only MMD adherent who has upgraded to Leopard? (I'm hoping the problem wasn't me being goofy, but it could be.)
Any corrections to my analysis are welcome and will be regarded as contributing to my education.
Please, no rulers on the knuckles. It's the holidays and all.
john
On 20 Dec 2007, at 22:27, John Laudun wrote:
[...] Any corrections to my analysis are welcome and will be regarded as contributing to my education.
I believe the problem is that ~ is normally not expanded inside quoted strings, e.g. echo "~" will output a literal ~. The solution is to instead use $HOME.
Now, the line you quoted had ~ as the fallback value for an unset variable inside a quoted string. I don’t know which rules to follow here, but I guess bash in Tiger expanded the ~ and on Leopard it does not.
Simple test: echo "${FOO:-~}" # not expanded on Leopard, probably was on Tiger
The workaround is (again) to use $HOME instead of ~.
Let me repeat my other line though about the bundle really should be using $TM_SUPPORT_PATH instead of relying on where it was installed.