tthatfreak

- friends
56 link karma
1,179 comment karma
send messageredditor for

Spring Cleaning Mega Giveaway - win 1000+ games! by NippleThiefin gaming

[–]tthatfreak 5 points6 points ago

Not taking one, but there are better ways to do this than with the public Google Doc. See this thread.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

Thanks. I'll try some of this out tonight (graveyard shift). I learned all about how the shell can't do floating point and have a percentage implementation right now that pumps out a "33.33%" report.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

would something like this work?

for files in (*.txt)
    do
        echo "i'm doing things"; i++ ; percentageCalc || continue
done

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

And a complete answer: I'm initially checking to see if I should even enter the main processing loop, then if a txt file is found, I process the files in a

for files in (*.txt)
    do
done

loop. As a byproduct, I'm using the total number of files in a percentage report. I know it's a little bit of an unnecessary overkill but it's a very handy thing.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

I need to know how many files of a certain type there are to make a percentage complete calculation.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

Also, I read the part about not checking to see if the file type exists to avoid the "not found" error, but in this case, I need to know how many files of a certain type there are (to make a percentage complete calculation). I think I oversimplified my example, but I think you shoved me in the right direction. We'll see when I return to work.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

So...

shopt -s nullglob dotglob
files=(*.txt)
if [ ${#files[@]} -lt 1 ]
then
echo "less than 1"
fi

?

And I think this is what I came for. I'm very new to bash scripting and love to learn that there are different and BETTER ways to do things.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

fixed. Thanks! I needed to put an extra line before the code or else it wouldn't take

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 1 point2 points ago

yar, i'm just seeing that now, I was actually wondering why the text looked so fancy.

BASH - supressing errors when piping to another program before taking value by tthatfreakin learnprogramming

[–]tthatfreak[S] 0 points1 point ago

!!! not at a terminal to try this out but I had previously seen the 2> being tossed around to suppress the errors. I didn't know I could pipe after that... Thanks!

Replacing shower doors while leaving current track in place by tthatfreakin DIY

[–]tthatfreak[S] 0 points1 point ago

My fear is that since it would be a "custom order" it would far exceed the cost of what an off-the-shelf door set would cost. And then there's the issue of it matching the other door.

One night in Cody, WY by tthatfreakin wyoming

[–]tthatfreak[S] 0 points1 point ago

Thanks for all your tips! Are you from the area?

We made our reservations already. We're staying at the Cody Cowboy Village since it fit in with out budget. We're hoping to see the sights, catch the fireworks, and then drive back to Yellowstone in the morning.

To my wife, who I caught reading through my comment history... by tthatfreakin funny

[–]tthatfreak[S] 0 points1 point ago

I think she's just curious. she's been lurking more and more. she was saddened by the poached elephant yesterday.

One night in Cody, WY by tthatfreakin wyoming

[–]tthatfreak[S] 0 points1 point ago

the 24 hour pool may take the cake... I'll see what the big fuss about the Irma is about. thanks for the tips!

One night in Cody, WY by tthatfreakin wyoming

[–]tthatfreak[S] 0 points1 point ago

I checked. there'll be a rodeo the day we are there... 4th of July!

One night in Cody, WY by tthatfreakin wyoming

[–]tthatfreak[S] 0 points1 point ago

oh sweet, I'll check that out. we're planning way in advance so hopefully we'll be okay.

To my wife, who I caught reading through my comment history... by tthatfreakin funny

[–]tthatfreak[S] 0 points1 point ago

I think it is a title you are free to claim.

One night in Cody, WY by tthatfreakin wyoming

[–]tthatfreak[S] 0 points1 point ago

What about the rodeo?

To my wife, who I caught reading through my comment history... by tthatfreakin funny

[–]tthatfreak[S] 1 point2 points ago

She's not a redditor!

view more: next