Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: A generic function/framework/mechanism for regular polling of data?
- X-seq: zsh-users 13129
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "Zsh users list" <zsh-users@xxxxxxxxxx>
- Subject: Re: A generic function/framework/mechanism for regular polling of data?
- Date: Mon, 11 Aug 2008 08:16:47 -0700
- In-reply-to: <2d460de70808110631y56666be3mbb3019553de5cc94@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2d460de70808071833p8871ca5m19159361b6eb855b@xxxxxxxxxxxxxx> <20080810131431.GB75798@xxxxxxxxxxxxxxxxxxxx> <2d460de70808110631y56666be3mbb3019553de5cc94@xxxxxxxxxxxxxx>
On Aug 11, 3:31pm, Richard Hartmann wrote:
}
} What, if any, is the canonical way to parse information from a file
} and putting that into variables.
The canonical way is for the file to be a simple series of assignment
statements, possibly with the occasional "typeset" command thrown in.
This is the reason that the shell uses an interpreted language. If a
way to load variables is all you're looking for, I don't understand why
you're making this into a programming problem.
} PS: Mental note: Cleanly seperate what I know and what I want to
} know when asking questions. Do not ask about the whole concept,
} only ask about the missing pieces.
Well, no. Context is often quite important. Frequently the problem
with programming questions is that the questioner wants to fill in a
missing piece when really it's the entire concept that's wrong (or at
least sub-optimal). At the very least lack of context makes it hard
to frame the right question.
Case in point: My answer above doesn't seem to accomplish your first
goal, which (I thought) was how to describe to the shell a parser for
information in arbitrary formats from various sources about assorted
system state. (The answer to which seems to be that no, zsh doesn't
have an internal equivalent of lex/yacc; the closest thing likely is
zregexparse, which is entirely undocumented except for the examples in
_regex_arguments in the completion system.)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author