$ ksh93  usr/src/tools/scripts/blah.sh
$0: "usr/src/tools/scripts/blah.sh"
whence $0: ""
dirname whence $0: "."

$ ./usr/src/tools/scripts/blah.sh
$0: "./usr/src/tools/scripts/blah.sh"
whence $0: "/export/home/alp/srcs/illumos-gate/./usr/src/tools/scripts/blah.sh"
dirname whence $0: "/export/home/alp/srcs/illumos-gate/./usr/src/tools/scripts"


С уважением,
Александр Пыхалов,
программист отдела телекоммуникационной инфраструктуры
управления информационно-коммуникационной инфраструктуры ЮФУ


________________________________________
От: Joshua M. Clulow <[email protected]>
Отправлено: 13 ноября 2018 г. 9:10:11
Кому: Illumos Discussion
Тема: Re: [discuss] new illumos build instructions

On Mon, 12 Nov 2018 at 21:08, Alexander Pyhalov via illumos-discuss
<[email protected]> wrote:
> When I try to  build illumos-gate according to new instructions, I get
>
> time ksh93 usr/src/tools/scripts/nightly.sh  ../illumos.sh
> dirname: missing operand
> Try 'dirname --help' for more information.
>
> (but build continues)

That definitely seems odd to me.  Can you put the following script in
"usr/src/tools/scripts/blah.sh" and try to run it instead:

---->8----
#!/bin/ksh -p

printf '$0: "%s"\n' "$0"
printf 'whence $0: "%s"\n' "$(whence "$0")"
printf 'dirname whence $0: "%s"\n' "$(dirname "$(whence "$0")")"

i=0
while [[ $# -gt 0 ]]; do
        printf 'arg[%3d]: "%s"\n' $i "$1"
        (( i++ ))
        shift 1
done
---->8----

When I run it with some arguments, I see this:

    $ time ksh93 usr/src/tools/scripts/blah.sh -a b
    $0: "usr/src/tools/scripts/blah.sh"
    whence $0: "/ws/rti/usr/src/tools/scripts/blah.sh"
    dirname whence $0: "/ws/rti/usr/src/tools/scripts"
    arg[  0]: "-a"
    arg[  1]: "b"

    real    0m0.029s
    user    0m0.009s
    sys     0m0.019s

What do you see?


Cheers.

--
Joshua M. Clulow
Engineer @ Joyent
http://blog.sysmgr.org

------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/Tb9ec5451a7d2f96a-M60b1da5708090f78ab485080
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to