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