[9fans] question about wildcard expansion in RC - Plan9

This is a discussion on [9fans] question about wildcard expansion in RC - Plan9 ; >From within a terminal, I type: % echo (/dev/sdC0) /dev/sdC0 % echo (/dev/sdC*) /dev/sdC0 /dev/sdC0 % test -f /dev/sd*/swap test: unexpected operator/operand: /dev/sdC0/swap Older versions of 'test' do not complain about the unexpected operator/operand and worked in termrc. But the ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: [9fans] question about wildcard expansion in RC

  1. [9fans] question about wildcard expansion in RC

    >From within a terminal, I type:

    % echo (/dev/sdC0)
    /dev/sdC0

    % echo (/dev/sdC*)
    /dev/sdC0 /dev/sdC0


    % test -f /dev/sd*/swap
    test: unexpected operator/operand: /dev/sdC0/swap



    Older versions of 'test' do not complain about the unexpected
    operator/operand and worked in termrc. But the recent version of "test"
    fails, as a result, the swap partition is not mounted.

    /Myron


  2. Re: [9fans] question about wildcard expansion in RC

    > Older versions of 'test' do not complain about the unexpected
    > operator/operand and worked in termrc. But the recent version of "test"
    > fails, as a result, the swap partition is not mounted.


    Google for 'test.command.is.broken' and you'll see this has been reported
    before. It would be a good idea to revert to the pre-12-August version
    of test, which was much less broken.

    I think /dev/sdC0 appears twice because it's bound into /dev once as
    part of the boot process, and again by termrc. This would be harmless
    without the 'test' bug.


  3. Re: [9fans] question about wildcard expansion in RC

    Thanks for your google tip. I saw your initial bug report.

    On 11/27/06, Richard Miller <9fans@hamnavoe.com> wrote:
    >
    > > Older versions of 'test' do not complain about the unexpected
    > > operator/operand and worked in termrc. But the recent version of "test"
    > > fails, as a result, the swap partition is not mounted.

    >
    > Google for 'test.command.is.broken' and you'll see this has been reported
    > before. It would be a good idea to revert to the pre-12-August version
    > of test, which was much less broken.
    >
    > I think /dev/sdC0 appears twice because it's bound into /dev once as
    > part of the boot process, and again by termrc. This would be harmless
    > without the 'test' bug.
    >
    >



  4. Re: [9fans] question about wildcard expansion in RC

    Myron wrote:
    >From within a terminal, I type:
    >
    > % echo (/dev/sdC0)
    > /dev/sdC0
    >
    > % echo (/dev/sdC*)
    > /dev/sdC0 /dev/sdC0
    >
    >
    > % test -f /dev/sd*/swap
    > test: unexpected operator/operand: /dev/sdC0/swap
    >
    >
    >
    > Older versions of 'test' do not complain about the unexpected
    > operator/operand and worked in termrc. But the recent version of "test"
    > fails, as a result, the swap partition is not mounted.
    >


    I got this a while back as well, and decided to rewrite that part of my termrc/cpurc:

    disk=''
    for(d in /dev/sd??)
    if(~ $disk '')
    if(test -f $d/swap)
    disk=`{ls /dev/sd*/swap >[2]/dev/null | sed 1q | sed 's!swap$!!'}
    if(! ~ $disk '')
    swap $disk^swap >/dev/null >[2=1]


    Robby

    --
    "Weg damit" is german for "get rid of this".



  5. Re: [9fans] question about wildcard expansion in RC

    I updated my system last night with "pull", and the test.c program has been
    fixed.

    /Myron

    On 11/28/06, Robert Raschke wrote:
    >
    > Myron wrote:
    > >From within a terminal, I type:
    > >
    > > % echo (/dev/sdC0)
    > > /dev/sdC0
    > >
    > > % echo (/dev/sdC*)
    > > /dev/sdC0 /dev/sdC0
    > >
    > >
    > > % test -f /dev/sd*/swap
    > > test: unexpected operator/operand: /dev/sdC0/swap
    > >
    > >
    > >
    > > Older versions of 'test' do not complain about the unexpected
    > > operator/operand and worked in termrc. But the recent version of "test"
    > > fails, as a result, the swap partition is not mounted.
    > >

    >
    > I got this a while back as well, and decided to rewrite that part of my
    > termrc/cpurc:
    >
    > disk=''
    > for(d in /dev/sd??)
    > if(~ $disk '')
    > if(test -f $d/swap)
    > disk=`{ls /dev/sd*/swap >[2]/dev/null |
    > sed 1q | sed 's!swap$!!'}
    > if(! ~ $disk '')
    > swap $disk^swap >/dev/null >[2=1]
    >
    >
    > Robby
    >
    > --
    > "Weg damit" is german for "get rid of this".
    >
    >
    >



+ Reply to Thread