Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
while {some command does not exit = 1)
- X-seq: zsh-users 17818
- From: TJ Luoma <luomat@xxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: while {some command does not exit = 1)
- Date: Mon, 3 Jun 2013 00:24:35 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=6dq063tRjXq+vUDmck+caNQF4sfs35M9F1KKXz+wLkc=; b=z3Fu8M7rwPpfiK5u8Sauu44s1h33PKRPoODg+RfOjO/kdYwrxsCwDjyesKea5m2Pg3 8Vl8Y53DCc/aS0FNoGZvJ6GYKYbHFvQ1Coqhtpo+CTSOaGYuVN4CPGTIxuRajjSJEWsM LHPo1Hph0hqbrPHleaaX9XDsnthOnG2WkW3lHz1SZ/BlYvsj4HtE+rsHAJEj7E3WVeoW huq8SIR/ElThFQ81Rq+4X1mu0IjYOqkMiCkLmzi9CpAgf5meswy7gIvmqDEqhNNPk76m ZJp55zcdbd5nBDmLNaprK36EYMHmXACl0Lv8ARmKvpN++lXvOJFEkBOzULEz8eK1U8Un UeeQ==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
I keep thinking that there must be an easier way to do this, but I
can't figure out what it would be, and Google has not helped.
I'm trying to create a "while" loop which will keep going as long as
some command does not exit = 0
Here's what I have been doing:
#!/bin/zsh -f
EXIT=1
while [ "$EXIT" = "1" ]
do
drutil discinfo | fgrep -q 'Please insert a disc to get disc info.'
EXIT="$?"
FOO
done
exit 0
# EOF
(where 'FOO' is some command I want to run)
What I keep thinking I ought to be able to do is something like this
while ((! drutil discinfo | fgrep -q 'Please insert a disc to get disc info.' ))
do
FOO
done
I realize that "while (( ))" syntax is wrong, but I hope the idea is
clear. It appears that the | might be what is making this not work.
Is there an easier way to do this?
TjL
Messages sorted by:
Reverse Date,
Date,
Thread,
Author