[go: up one dir, main page]

Menu

[267579]: / man / en_US / shift.tea  Maximize  Restore  History

Download this file

51 lines (38 with data), 2.1 kB

 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
39
40
41
42
43
44
45
46
47
48
49
50
#
# Dos9 Manual pages, The Dos9 project
# Copyright (C) 2012-2015 Romain Garbi (DarkBatcher)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
{{SHIFT Command}}
The {SHIFT} command shifts batch script arguments. This command is
very useful to create batch scripts requiring many parameters.
{{Synopsis}}
${SHIFT [/start | /s[:]start] [/d[:]step]}
Changes position of parameters within the variable {%0} to {%9}.
- {/start} ou {/s[:]start} : Specify a number {start} between {0} and {9} that indicate
at which parameters the command should start. The first syntax is compatible with {cmd.exe}
while the other one is not. By default, displacement of parameters starts at {%0}.
- {/d[:]step} : Specify the length of the displacement. {Step} has to be a number between {0}
and {9}. The default value is {1}. This is a Dos9 extension.
Displacement takes place from the the lowest parameter to the highest. If any argument is left
empty by the process, then {SHIFT} tries to put some additional arguments using remaining
arguments stored in {%+}. If {%+} is already empty, these variables are left empty.
The content of the variable {%*} is not modified by the {SHIFT} command.
{{Compatibility}}
Mostly compatible with {cmd.exe}. Indeed, while replacing the {%0} parameter, {cmd.exe}
checks that the new argument refers to a file or a directory and if it is not, replace it
by the current directory. This behaviours is not implemented by Dos9.
{{See Also}}
{commands|Commands list}, {dos9|Dos9}