source: grub-pc/trunk/fuentes/tests/grub_script_shift.in @ 22

Last change on this file since 22 was 22, checked in by mabarracus, 4 years ago

updated version and apply net.ifnames=0 into debian/rules

File size: 1.5 KB
Line 
1#! @builddir@/grub-shell-tester
2
3# Run GRUB script in a Qemu instance
4# Copyright (C) 2010  Free Software Foundation, Inc.
5#
6# GRUB is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# GRUB is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
18
19function f1 {
20  echo f1 '$@' $@
21  echo f1 '$*' $*
22  echo f1 $# $1 $2 $3
23  shift
24  echo f1 '$@' $@
25  echo f1 '$*' $*
26  echo f1 $# $1 $2 $3
27}
28
29f1
30f1 a
31f1 a b
32f1 a b c
33f1 a b c d
34f1 a b c d e
35
36function f2 {
37  echo f1 '$@' $@
38  echo f1 '$*' $*
39  echo f2 $# $1 $2 $3
40  shift 1
41  echo f1 '$@' $@
42  echo f1 '$*' $*
43  echo f2 $# $1 $2 $3
44}
45
46f2
47f2 a
48f2 a b
49f2 a b c
50f2 a b c d
51f2 a b c d e
52
53function f3 {
54  echo f1 '$@' $@
55  echo f1 '$*' $*
56  echo f3 $# $1 $2 $3
57  shift 3
58  echo f1 '$@' $@
59  echo f1 '$*' $*
60  echo f3 $# $1 $2 $3
61}
62
63f3
64f3 a
65f3 a b
66f3 a b c
67f3 a b c d
68f3 a b c d e
69
70function f4 {
71  echo f1 '$@' $@
72  echo f1 '$*' $*
73  echo f4 $# $1 $2 $3
74  shift 100
75  echo f1 '$@' $@
76  echo f1 '$*' $*
77  echo f4 $# $1 $2 $3
78}
79
80f4
81f4 a
82f4 a b
83f4 a b c
84f4 a b c d
85f4 a b c d e
Note: See TracBrowser for help on using the repository browser.