logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

shift.1p (2890B)


  1. '\" et
  2. .TH SHIFT "1P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. shift
  12. \(em shift positional parameters
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. shift \fB[\fIn\fB]\fR
  17. .fi
  18. .SH DESCRIPTION
  19. The positional parameters shall be shifted. Positional parameter 1
  20. shall be assigned the value of parameter (1+\fIn\fP), parameter 2 shall
  21. be assigned the value of parameter (2+\fIn\fP), and so on. The
  22. parameters represented by the numbers
  23. .BR \(dq$#\(dq
  24. down to
  25. .BR \(dq$#-n+1\(dq
  26. shall be unset, and the parameter
  27. .BR '#'
  28. is updated to reflect the new number of positional parameters.
  29. .P
  30. The value
  31. .IR n
  32. shall be an unsigned decimal integer less than or equal to the value of
  33. the special parameter
  34. .BR '#' .
  35. If
  36. .IR n
  37. is not given, it shall be assumed to be 1. If
  38. .IR n
  39. is 0, the positional and special parameters are not changed.
  40. .SH OPTIONS
  41. None.
  42. .SH OPERANDS
  43. See the DESCRIPTION.
  44. .SH STDIN
  45. Not used.
  46. .SH "INPUT FILES"
  47. None.
  48. .SH "ENVIRONMENT VARIABLES"
  49. None.
  50. .SH "ASYNCHRONOUS EVENTS"
  51. Default.
  52. .SH STDOUT
  53. Not used.
  54. .SH STDERR
  55. The standard error shall be used only for diagnostic messages.
  56. .SH "OUTPUT FILES"
  57. None.
  58. .SH "EXTENDED DESCRIPTION"
  59. None.
  60. .SH "EXIT STATUS"
  61. If the
  62. .IR n
  63. operand is invalid or is greater than
  64. .BR \(dq$#\(dq ,
  65. this may be considered a syntax error and a non-interactive shell may
  66. exit; if the shell does not exit in this case, a non-zero exit status
  67. shall be returned. Otherwise, zero shall be returned.
  68. .SH "CONSEQUENCES OF ERRORS"
  69. Default.
  70. .LP
  71. .IR "The following sections are informative."
  72. .SH "APPLICATION USAGE"
  73. None.
  74. .SH EXAMPLES
  75. .LP
  76. .nf
  77. \fB$\fR set a b c d e
  78. \fB$\fR shift 2
  79. \fB$\fR echo $*
  80. \fBc d e\fR
  81. .fi
  82. .SH "RATIONALE"
  83. None.
  84. .SH "FUTURE DIRECTIONS"
  85. None.
  86. .SH "SEE ALSO"
  87. .IR "Section 2.14" ", " "Special Built-In Utilities"
  88. .\"
  89. .SH COPYRIGHT
  90. Portions of this text are reprinted and reproduced in electronic form
  91. from IEEE Std 1003.1-2017, Standard for Information Technology
  92. -- Portable Operating System Interface (POSIX), The Open Group Base
  93. Specifications Issue 7, 2018 Edition,
  94. Copyright (C) 2018 by the Institute of
  95. Electrical and Electronics Engineers, Inc and The Open Group.
  96. In the event of any discrepancy between this version and the original IEEE and
  97. The Open Group Standard, the original IEEE and The Open Group Standard
  98. is the referee document. The original Standard can be obtained online at
  99. http://www.opengroup.org/unix/online.html .
  100. .PP
  101. Any typographical or formatting errors that appear
  102. in this page are most likely
  103. to have been introduced during the conversion of the source files to
  104. man page format. To report such errors, see
  105. https://www.kernel.org/doc/man-pages/reporting_bugs.html .