[TriLUG] e2fsck under cron gets retcode=8 operational error

Joseph Mack NA3T jmack at wm7d.net
Wed Sep 19 07:47:50 EDT 2012


On Wed, 19 Sep 2012, Thomas Gardner wrote:

>> eg the output of df: if the name of the device or the 
>> output is too long, df puts a <cr> in the middle of the 
>> line, splitting the output into two lines. Now you can't 
>> grep for a device and expect to find the mount point 
>> because they're on different lines. I don't know how 
>> you're supposed to do it.
>
> You use -P option, that's how.

I didn't know that. :-( Thanks

Still I expect the default to be the one that works. If you 
want to split lines, breaking machine readability, then 
that should be an option, not the default.

> Even without the -P, it's not all that hard to get the 
> same result by adding an extra stage in your pipeline to 
> get the same kind of result. That's how I used to do it 
> before I noticed -P in df's man page.  Awk would probably 
> be the easiest way (something like 
> 'NF==1{dev=$1;next}{print dev $0;dev=""}'

I've never used awk beyond picking columns. You're 
considerably more dexterous with it than I am.

We (FOSS) are not going to win if you have to do something 
like this every time to handle the broken utilities.

> but you could do it with sed,

I don't know how you'd do that.

> and certainly Perl could handle it (talk about sending a 
> cannon for a pea shooter's job), or probably a bazillion 
> other tools, too.

again you're just saying loudly to the world that you accept 
that the utilities (in this case df) don't work. What if you 
have restricted memory and can't have perl, or you need to 
do 100 of these at each iteration and you don't want to have 
to run a perl script each time?

> You could probably do it with bf

I don't know bf sorry

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list