File: example.ia-c-C

package info (click to toggle)
shellia 5.7.6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 728 kB
  • sloc: sh: 7,087; makefile: 34
file content (38 lines) | stat: -rwxr-xr-x 549 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# vim: set filetype=sh :
#        file: example.ia-c-C
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
#     license: GNU General Public License, version 3
# description: example handling ia options -c and -C
#    see also: test.ia-c-C
set -e
set -u

. ./ia

f()
{
  seq 10 |
  while read l; do
    [ "$(($l % 2))" = "0" ] && echo "$l.out" || echo "$l.err" >&2
  done
}

f_r()
{
  eval "$ia_init"
  ia_add "f"
  ia -c
}

f_R()
{
  eval "$ia_init"
  ia_add "f"
  ia -C
}

eval "$ia_init"
ia_add "f_r"
ia_add "f_R"
ia