![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 23/02/2013 07:56 PM, nemesis wrote:
> fun indeed
>
> I mean, to put a windoze guy on charge of Linux stuff :)
I love that everybody else in the room is LPIC-certified, yet I'm the
one doing the crazy Linux stuff. ;-)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 23/02/2013 10:24 PM, Francois Labreque wrote:
> 1. Redirect stderr to a different file. And check for that file being
> more than 0 bytes before claiming the install completed succesfully.
Ooo, here's an interesting question - what is the size of /dev/sda? Is
it the size of the special file, or the device to which it refers?
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Orchid Win7 v1 <voi### [at] dev null> wrote:
> I agree. However, unfortunately it seems that by default Bash ignores
> all such errors and happily proceeds, unless you manually suffix every
> single command with an explicit return-code check.
How is that different from any programming language?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On 24/02/2013 12:03 PM, Warp wrote:
> Orchid Win7 v1<voi### [at] dev null> wrote:
>> I agree. However, unfortunately it seems that by default Bash ignores
>> all such errors and happily proceeds, unless you manually suffix every
>> single command with an explicit return-code check.
>
> How is that different from any programming language?
In C#, Java or similar, if you try to open a file and can't, an
exception is thrown, and your program is halted. (Unless you thought of
that eventuality and coded a catch{} block for it.) In Bash, the program
continues to execute as if everything worked just fine, silently
ignoring the error.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Am 24.02.2013 12:52, schrieb Orchid Win7 v1:
> On 24/02/2013 12:06 AM, Warp wrote:
>> All programs should return an error code if an error happens. If a
>> program
>> ends in error but returns a success code, that program is broken
>
> I agree. However, unfortunately it seems that by default Bash ignores
> all such errors and happily proceeds, unless you manually suffix every
> single command with an explicit return-code check.
#!/bin/bash -e
Have fun!
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sun, 24 Feb 2013 11:53:05 +0000, Orchid Win7 v1 wrote:
> On 23/02/2013 07:56 PM, nemesis wrote:
>> fun indeed
>>
>> I mean, to put a windoze guy on charge of Linux stuff :)
>
> I love that everybody else in the room is LPIC-certified, yet I'm the
> one doing the crazy Linux stuff. ;-)
Just goes to show that certification doesn't always mean "expert". As
I've said before, a cert is a measure of the minimally-qualified
candidate. :)
Well done. :)
Jim
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
On Sun, 24 Feb 2013 12:21:51 +0000, Orchid Win7 v1 wrote:
> On 24/02/2013 12:03 PM, Warp wrote:
>> Orchid Win7 v1<voi### [at] dev null> wrote:
>>> I agree. However, unfortunately it seems that by default Bash ignores
>>> all such errors and happily proceeds, unless you manually suffix every
>>> single command with an explicit return-code check.
>>
>> How is that different from any programming language?
>
> In C#, Java or similar, if you try to open a file and can't, an
> exception is thrown, and your program is halted. (Unless you thought of
> that eventuality and coded a catch{} block for it.) In Bash, the program
> continues to execute as if everything worked just fine, silently
> ignoring the error.
The exception handling part is a feature of OO programming languages,
IIRC. Bash scripting is far from OOP. ;)
Jim
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
>> I agree. However, unfortunately it seems that by default Bash ignores
>> all such errors and happily proceeds, unless you manually suffix every
>> single command with an explicit return-code check.
>
> #!/bin/bash -e
>
> Have fun!
I think you mean "set -e", but anyway...
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
> The exception handling part is a feature of OO programming languages,
> IIRC. Bash scripting is far from OOP. ;)
I think exception handling predates OO. But whatever; Bash is a
_scripting language_. It is meant for writing short, simple scripts, but
building large, complex, mission-critical applications.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Orchid Win7 v1 <voi### [at] dev null> wrote:
> I think exception handling predates OO.
The first object-oriented programming language was Simula, developed
in 1967. When was exception handling first used?
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |