Mailinglist Archive: opensuse (4633 mails)

< Previous Next >
Re: [opensuse] Boxed 10.2 orders (OT)
  • From: Jeffery Fernandez <forums@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Thu, 28 Dec 2006 13:36:06 +1100
  • Message-id: <200612281336.06401.forums@xxxxxxxxxxxxxxxxxxxxxx>
On Thursday 28 December 2006 12:41, Randall R Schulz wrote:
> 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)"

Thanks Randall :)

Jeffery
>
>
> 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

--
Powered by openSUSE 10.2 (i586) Kernel: 2.6.18.2-34-default
KDE: 3.5.5 "release 45"
1:35pm up 2 days 14:26, 4 users, load average: 0.41, 1.07, 1.29
--
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >