From: Sascha Hauer <s.hauer@pengutronix.de>
To: Thibaut Dambry <tdambry@atysmedical.com>
Cc: barebox@lists.infradead.org
Subject: Re: redirect stdout
Date: Wed, 4 Jun 2014 12:19:42 +0200 [thread overview]
Message-ID: <20140604101942.GF15686@pengutronix.de> (raw)
In-Reply-To: <538EE612.1050105@atysmedical.com>
On Wed, Jun 04, 2014 at 11:25:38AM +0200, Thibaut Dambry wrote:
> Hello
>
> I'm sorry if it is a dummy question, but I don't find a answer.
> I would like do that in a barebox hush shell:
>
> value=`i2c_read -a 0x52 -b 0 -r 0x01 -c 1`
>
> But the shell don't interpret the ``.
>
> Is there a method to do that ?
There is no redirection of any kind in barebox and this is not trivial
to implement.
You are trying to read a i2c register into a variable. This is not
possible with the current implementation of the i2c command. Some
commands work around this by adding a commandline parameter which lets
you specify a variable in which the result is written, see for example
the readline command. The i2c_read command could be extended similarly.
OTOH most of the time this comes up it is better to implement a proper
driver for the device. In case it's an EEPROM you're trying to access
here you also better write C Code to interpret its content. This kind
of shell parsing is often very fragile.
>
> Thank you for this exciting software, I would contribute but I'm a
> little intimidate by the great quality of hackers in this list.
C'mon, we do not bite ;)
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-06-04 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 9:25 Thibaut Dambry
2014-06-04 10:19 ` Sascha Hauer [this message]
2014-06-04 16:11 ` Thibaut Dambry
2014-06-05 5:47 ` Sascha Hauer
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=20140604101942.GF15686@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=tdambry@atysmedical.com \
/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