Mailinglist Archive: opensuse (4633 mails)

< Previous Next >
Re: [opensuse] Boxed 10.2 orders (OT)
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Wed, 27 Dec 2006 17:41:01 -0800
  • Message-id: <200612271741.01633.rschulz@xxxxxxxxx>
On Wednesday 27 December 2006 16:09, Jeffery Fernandez wrote:
> ...
>
> cool idea.. I made it a bit more dynamic with the following:
>
> #!/bin/bash
> powered=`cat /etc/SuSE-release | head -n 1`

We need to nip these "cat piped to" things in the bud. Here's the more
succint, more efficient equivalent:

powered="$(head -n 1 /etc/SuSE-release)"


Very few command-line programs read only from the standard input, not
accepting a file name, and in those cases, you just want to use
ordinary "less-than" redirection:

variable="$(commandThatOnlyReadsStandardInput < fileName)"


> ...


Randall Schulz
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups