Re: Space in POSIX path/Terminal shell
Re: Space in POSIX path/Terminal shell
- Subject: Re: Space in POSIX path/Terminal shell
- From: Philippe GRUCHET <email@hidden>
- Date: Sat, 5 Apr 2003 11:08:54 +0200
From: Jon Pugh <email@hidden>
The original string path format is:
":Applications:Maths:Mathematica 4.2.app:Contents:MacOS:MathKernel"
If I type in the Terminal after [bla bla ~] philippe%
/Applications/Maths/Mathematica 4.2.app/Contents/MacOS/MathKernel
/Applications/Maths/Mathematica 4.2.app/Contents/MacOS/MathKernel
=> Command not found.
Unix shells, of which the Terminal uses one, typically bash these
days, require a different kind of escaping for spaces and other
special characters. This is completely unrelated to URIs.
Ha, ok!
So, question: unrelated... undocumented... where to find THE rule?
TIA!
You can also place a backslash in front of a single character to
escape it. Like so:
/Applications/Maths/Mathematica\ 4.2.app/Contents/MacOS/MathKernel
Yes, I first tried this typical Unix format => Command not found.
Dumbfounded!
<keep cool> Bizarre... X for UNIX or for UNKNOWN... </keep cool>
The simplest solution is to quote the path, with either single or
double quotes. Both work, as long as they match. For example, these
work:
"/Applications/Maths/Mathematica 4.2.app/Contents/MacOS/MathKernel"
'/Applications/Maths/Mathematica 4.2.app/Contents/MacOS/MathKernel'
Breathtaking! Both of them work fine in the 'beast' without flinching.
It's a great help you bring me there John!
Lesson n0 1: Simplest is often the best!
These are particular to the shell you are using,
I'm using the standard protocol:
TTY: dev/ttyp1
Shell: tcsh
and passing commands from AppleScript to "do shell script" can cause
you to need multiple levels of escaping in order to make it through
the various layers.
Yes, you're right!
Reason why I don't use here a 'do shell script' command but just
passing variables in something like:
--------------------------------------------
set theScript to "
'/Applications/Maths/Mathematica 4.2.app/Contents/MacOS/MathKernel'
3*3
9^-27
Integrate[Sqrt[x]*Sqrt[a + x], x]
Solve[Sqrt[x] + a == 2*x, x]
Eigenvalues[{{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}]
Exit[]
"
tell application "Terminal" to do script theScript
--------------------------------------------
Note 1: Works really fine in one shell window.
Note 2: If you want examples with results, let me know.
In these cases, experimentation and a clue go a long way. ;)
I did experimentations and you had the clue ;)
Hopefully that helps some.
Myself, at least :-)
Thanks again John!
Kind regards,
Philippe Gruchet/SVM Mac
VNU Publications France
http://svmmac.vnunet.fr
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.