File: test.ia_mktemp

package info (click to toggle)
shellia 5.10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 792 kB
  • sloc: sh: 7,840; makefile: 34
file content (38 lines) | stat: -rwxr-xr-x 1,001 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: test.ia_mktemp
#   copyright: Bernd Schumacher <bernd.schumacher@hpe.com> (2007-2020)
#     license: GNU General Public License, version 3
# description: test using shell script functions
# description: test using function ia_mktemp and ia_rmtemp
#    see also: example.ia_mktemp

# The following tests are included:
# (1) Run ia_mktemp

. ./tstlib

UNIFY_tmpfile_name="sed -e \"s:/tmp/shellia.*:/tmp/shellia:\""
bug913718_unify UNIFY_tmpfile_name

shell=""
while [ $# -ne 0 ]; do
  if [ "$1" = "-s" ]; then
    shell="$2"
    shift 2
  else
    echo "ERROR $0: unknown option <$1>" >&2
    exit 1
  fi
done

[ "$shell" ] && set -- "$@" -s "$shell"
set -- "$@" -u "$UNIFY_tmpfile_name"

cmd=$(dirname $0)/example.ia_mktemp
bug913718_cmd
check "(1) Run ia_mktemp" "$@" "$cmd" "sub: file exists: /tmp/shellia
main: file exists: /tmp/shellia
main: file does not exist: /tmp/shellia
sub: file exists: /tmp/shellia
main: file does not exist: /tmp/shellia"