Hi *,
On Thu, Jun 26, 2008 at 9:36 AM, Andre Schnabel <[EMAIL PROTECTED]> wrote:
>> Von: "Zhu Lihua" <[EMAIL PROTECTED]>
>>
>> my_dir=`dirname "$0"`
>> "$my_dir/run_tests.sh" < "$my_dir/../ooo_releasetests.lst"
> [...]
>> I replace the word dirname with the dirctory "/qa/qatestool/script/unix".
>
> "$0" expands to the full file name (including path) of the script. The command
> dirname $0
> will give the path of the current script. Note that "dirname" is considered
> as command in this case (enclosed in `). So if you replace the command
> "dirname" by the directory name, this will fail (a directory cannot be
> executed).
To add on that: The dirname $0 is in so called backticks: ` - this is
different from an apostrophe (')
Backticks in a shellscript mean: Execute the expression that is
enclosed with the backticks and return the output of the command.
An alternative way in bash is to use the $(command to execute)
notation (i.e. put the command in $( )
So it is not enough to replace dirname "$0", but you would have to
remove or change the backticks to regular quotes. (or you use don't
use the script, but the run_test.sh one, as Andre mentioned)
ciao
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]