On 08/01/2017 10:00 AM, Ian Zimmerman wrote:
> On 2017-08-01 03:00, Daniel Campbell wrote:
>
>> # Add '-s' to interactively set the window to be captured.
>> screenie() {
>> local curdir=$(pwd)
>> local shotname=$(date +%Y-%m-%d_%H-%M).png
>> echo "5 seconds! Go go go!"
>> cd ~/img/screens/comp/
>> scrot -d 5 -q 70 "$shotname" ${@}
>> echo "Screen taken! Find it under ~/img/screens/comp."
>> cd $curdir
>> }
>>
>> (now that I'm looking at it, it could use a spruce up to use pushd/popd
>> instead of storing the starting dir in a variable...)
>
> pushd and popd are bashisms, your current way works with any POSIX shell.
>
That's good to know!I went in search of a few portable shell resources. Some suggest to use dash or posh for the testing environment. I also found shellcheck, which looks pretty promising (and it's in the tree! Thanks jlec). Do you have any experience in portable shell scripting? My web search didn't return a whole lot of good resources. Mostly just Stack Overflow and a few tutorials which pointed to other resources. What do you suggest? -- Daniel Campbell - Gentoo Developer OpenPGP Key: 0x1EA055D6 @ hkp://keys.gnupg.net fpr: AE03 9064 AE00 053C 270C 1DE4 6F7A 9091 1EA0 55D6
signature.asc
Description: OpenPGP digital signature

