~vcs-imports/busybox/trunk

« back to all changes in this revision

Viewing changes to applets_sh/mim

  • Committer: Denys Vlasenko
  • Author(s): Christian Franke
  • Date: 2023-11-13 10:32:35 UTC
  • Revision ID: git-v1:a63b60bdd6fa26b867c80d44074118babbae7ffd
Cygwin: regenerate defconfig

Signed-off-by: Christian Franke <christian.franke@t-online.de>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
MIMFILE="Mimfile"
 
3
if [ $# -ge 2 ] && [ "$1" = "-f" ]
 
4
then
 
5
        MIMFILE="$2"
 
6
        shift 2
 
7
fi
 
8
exec <"$MIMFILE" || exit 1
 
9
{
 
10
        INCASE=false
 
11
        while read -r REPLY
 
12
        do
 
13
                case $REPLY in
 
14
                *:)
 
15
                        if ! $INCASE
 
16
                        then
 
17
                                printf '[ $# -eq 0 ] && set -- "%s"
 
18
TARGET="$1"
 
19
shift
 
20
case "$TARGET" in
 
21
' "${REPLY%:}"
 
22
                        else
 
23
                                printf ';;\n'
 
24
                        fi
 
25
                        printf '%s)\n' "${REPLY%:}"
 
26
                        INCASE=true
 
27
                        ;;
 
28
                "") ;;
 
29
                *) printf '%s\n' "${REPLY##[    ]}";;
 
30
                esac
 
31
        done
 
32
        $INCASE && printf ';;\n'
 
33
        printf '*)
 
34
echo "Unknown command $TARGET"
 
35
exit 1
 
36
;;
 
37
esac
 
38
'
 
39
} | sh -s "$@"