Search Results

Search: Posts Made By: pvdb
7,180
Posted By pvdb
Setting "default" positional parameters (in bash)
Hi,

I have a script that processes the positional parameters provided on the command line, or - if none are provided - uses some defaults instead.

I've currently got it written as follows,...
77,374
Posted By pvdb
Hi cfajohnson, Yes, absolutely agree,...
Hi cfajohnson,



Yes, absolutely agree, and your version of the script is definitely the way to go, but by posting my corrected patch, I was just finishing what I started, so to speak :)
77,374
Posted By pvdb
Hi Corona688, All good points you...
Hi Corona688,



All good points you raise... here's a unified diff of the two scripts, which also addresses the issue you correctly point out with printf control characters in the prefix:

...
77,374
Posted By pvdb
Hi cfajohnson, Thanks for your version of...
Hi cfajohnson,

Thanks for your version of the script... very enlightening!

Quick question: instead of doing a "raw" sleep...

sleep 1

your version does this instead...


sleep 1 &
...
77,374
Posted By pvdb
Great little script, Corona688, just what I...
Great little script, Corona688, just what I needed! :b:

Here's a little variant I wrote that allows you to prefix the countdown timer with a custom message:

countdown "00:07:55" Time left...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy