Re: substitute variable





On 1/30/2008 9:57 AM, Richard wrote:
Hi,

I want to substitute a variable. My script code is

#!/bin/sh
MYDIR="/usr/"
echo "${MYDIR}file.cpp"

What I want to see after running the script (ksh)

Why did you say "(ksh)" when your shebang says "/bin/sh"?

is /usr/file.cpp but
what I see is only file.cpp.

That's hard to believe. Assuming your script is in a file named "foo" under your
current directory, do this:

$ cat foo
$ ./foo

and post the result.

Ed.


.



Relevant Pages