Gentoo Archives: gentoo-user

From: R0b0t1 <r030t1@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: maim screenshooting
Date: Thu, 03 Aug 2017 07:23:19
Message-Id: CAAD4mYgsRZ6mWrHJvy9S1jEr+e9y91d2UCAgHtVAsPvejSYxzA@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: maim screenshooting by Daniel Campbell
1 On Thu, Aug 3, 2017 at 12:36 AM, Daniel Campbell <zlg@g.o> wrote:
2 > On 08/01/2017 10:00 AM, Ian Zimmerman wrote:
3 >> On 2017-08-01 03:00, Daniel Campbell wrote:
4 >>
5 >>> # Add '-s' to interactively set the window to be captured.
6 >>> screenie() {
7 >>> local curdir=$(pwd)
8 >>> local shotname=$(date +%Y-%m-%d_%H-%M).png
9 >>> echo "5 seconds! Go go go!"
10 >>> cd ~/img/screens/comp/
11 >>> scrot -d 5 -q 70 "$shotname" ${@}
12 >>> echo "Screen taken! Find it under ~/img/screens/comp."
13 >>> cd $curdir
14 >>> }
15 >>>
16 >>> (now that I'm looking at it, it could use a spruce up to use pushd/popd
17 >>> instead of storing the starting dir in a variable...)
18 >>
19 >> pushd and popd are bashisms, your current way works with any POSIX shell.
20 >>
21 > That's good to know!
22 >
23 > I went in search of a few portable shell resources. Some suggest to use
24 > dash or posh for the testing environment. I also found shellcheck, which
25 > looks pretty promising (and it's in the tree! Thanks jlec). Do you have
26 > any experience in portable shell scripting? My web search didn't return
27 > a whole lot of good resources. Mostly just Stack Overflow and a few
28 > tutorials which pointed to other resources.
29 >
30 > What do you suggest?
31
32 Ash, BusyBox's shell, is a good testing environment. Vim's syntax
33 highlighting will make Bashisms bright red if the shebang line
34 specifies /bin/sh.