9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Robert Raschke <r.raschke@tombobWegDamit.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] question about wildcard expansion in RC
Date: Tue, 28 Nov 2006 10:08:28 +0000	[thread overview]
Message-ID: <23342e9a00ff47ea7e567339fec7e693@tombob.com> (raw)
In-Reply-To: <95dfc7de0611271028m7cadc3y7a7931dc5c107dfd@mail.gmail.com>

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".




  parent reply	other threads:[~2006-11-28 10:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27 18:28 Myron Cheung
2006-11-27 19:16 ` Richard Miller
2006-11-27 20:08   ` Myron Cheung
2006-11-28 10:08 ` Robert Raschke [this message]
2006-11-28 14:40   ` Myron Cheung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23342e9a00ff47ea7e567339fec7e693@tombob.com \
    --to=r.raschke@tombobwegdamit.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).