components/ksh93/files/ksh.1
changeset 3742 55497e208813
parent 953 a0fb7976f6c7
equal deleted inserted replaced
3741:5813a4ba7644 3742:55497e208813
     1 '\" te
     1 '\" te
     2 .\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
     2 .\" Copyright (c) 1982-2007 AT&T Knowledge Ventures
     3 .\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
     3 .\" To view license terms, see http://www.opensource.org/licenses/cpl1.0.txt
     4 .\" Portions Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
     4 .\" Portions Copyright (c) 2009, 2015, Oracle and/or its affiliates. All    rights reserved.
     5 .TH ksh 1 "4 Jan 2012" "SunOS 5.11" "User Commands"
     5 .TH ksh 1 "4 Feb 2015" "SunOS 5.12" "User Commands"
     6 .SH NAME
     6 .SH NAME
     7 ksh, ksh93, rksh \- Korn Shell, a standard and restricted command and programming language
     7 ksh, ksh93, rksh \- Korn Shell, a standard and restricted command and programming language
     8 .SH SYNOPSIS
     8 .SH SYNOPSIS
     9 .LP
     9 .LP
    10 .nf
    10 .nf
   982 .ne 2
   982 .ne 2
   983 .mk
   983 .mk
   984 .na
   984 .na
   985 \fB\fBCDPATH\fR\fR
   985 \fB\fBCDPATH\fR\fR
   986 .ad
   986 .ad
   987 .RS 14n
   987 .sp .6
   988 .rt  
   988 .RS 4n
   989 Defines the search path for the \fBcd\fR command.
   989 Defines the search path for the \fBcd\fR command.
   990 .RE
   990 .RE
   991 
   991 
   992 .sp
   992 .sp
   993 .ne 2
   993 .ne 2
   994 .mk
   994 .mk
   995 .na
   995 .na
   996 \fB\fBCOLUMNS\fR\fR
   996 \fB\fBCOLUMNS\fR\fR
   997 .ad
   997 .ad
   998 .RS 14n
   998 .sp .6
   999 .rt  
   999 .RS 4n
  1000 Defines the width of the edit window for the shell edit modes and for printing select lists.
  1000 Defines the width of the edit window for the shell edit modes and for printing select lists.
  1001 .RE
  1001 .RE
  1002 
  1002 
  1003 .sp
  1003 .sp
  1004 .ne 2
  1004 .ne 2
  1005 .mk
  1005 .mk
  1006 .na
  1006 .na
  1007 \fB\fBEDITOR\fR\fR
  1007 \fB\fBEDITOR\fR\fR
  1008 .ad
  1008 .ad
  1009 .RS 14n
  1009 .sp .6
  1010 .rt  
  1010 .RS 4n
  1011 If the \fBVISUAL\fR variable is not set, the value of this variable is checked for the patterns as described with \fBVISUAL\fR and the corresponding editing option is turned on. 
  1011 If the \fBVISUAL\fR variable is not set, the value of this variable is checked for the patterns as described with \fBVISUAL\fR and the corresponding editing option is turned on. 
  1012 .sp
  1012 .sp
  1013 See the \fBset\fR command in the \fBSpecial Command\fR section of this manual page. 
  1013 See the \fBset\fR command in the \fBSpecial Command\fR section of this manual page. 
  1014 .RE
  1014 .RE
  1015 
  1015 
  1017 .ne 2
  1017 .ne 2
  1018 .mk
  1018 .mk
  1019 .na
  1019 .na
  1020 \fB\fBENV\fR\fR
  1020 \fB\fBENV\fR\fR
  1021 .ad
  1021 .ad
  1022 .RS 14n
  1022 .sp .6
  1023 .rt  
  1023 .RS 4n
  1024 Performs parameter expansion, command substitution, and arithmetic substitution on the value to generate the pathname of the script that is executed when the shell is invoked. This file is typically used for alias and function definitions. The default value is \fB$HOME/.kshrc\fR. 
  1024 Performs parameter expansion, command substitution, and arithmetic substitution on the value to generate the pathname of the script that is executed when the shell is invoked. This file is typically used for alias and function definitions. The default value is \fB$HOME/.kshrc\fR. 
  1025 .sp
  1025 .sp
  1026 See the \fBInvocation\fR section of this manual page.
  1026 See the \fBInvocation\fR section of this manual page.
  1027 .sp
  1027 .sp
  1028 \fBENV\fR is not set by the shell. 
  1028 \fBENV\fR is not set by the shell. 
  1032 .ne 2
  1032 .ne 2
  1033 .mk
  1033 .mk
  1034 .na
  1034 .na
  1035 \fB\fBFCEDIT\fR\fR
  1035 \fB\fBFCEDIT\fR\fR
  1036 .ad
  1036 .ad
  1037 .RS 14n
  1037 .sp .6
  1038 .rt  
  1038 .RS 4n
  1039 Obsolete name for the default editor name for the \fBhist\fR command. \fBFCEDIT\fR is not used when \fBHISTEDIT\fR is set.
  1039 Obsolete name for the default editor name for the \fBhist\fR command. \fBFCEDIT\fR is not used when \fBHISTEDIT\fR is set.
  1040 .sp
  1040 .sp
  1041 The shell specifies a default value to \fBFCEDIT\fR.
  1041 The shell specifies a default value to \fBFCEDIT\fR.
  1042 .RE
  1042 .RE
  1043 
  1043 
  1045 .ne 2
  1045 .ne 2
  1046 .mk
  1046 .mk
  1047 .na
  1047 .na
  1048 \fB\fBFIGNORE\fR\fR
  1048 \fB\fBFIGNORE\fR\fR
  1049 .ad
  1049 .ad
  1050 .RS 14n
  1050 .sp .6
  1051 .rt  
  1051 .RS 4n
  1052 A pattern that defines the set of file names that is ignored when performing file name matching.
  1052 A pattern that defines the set of file names that is ignored when performing file name matching.
  1053 .RE
  1053 .RE
  1054 
  1054 
  1055 .sp
  1055 .sp
  1056 .ne 2
  1056 .ne 2
  1057 .mk
  1057 .mk
  1058 .na
  1058 .na
  1059 \fB\fBFPATH\fR\fR
  1059 \fB\fBFPATH\fR\fR
  1060 .ad
  1060 .ad
  1061 .RS 14n
  1061 .sp .6
  1062 .rt  
  1062 .RS 4n
  1063 The search path for function definitions. The directories in this path are searched for a file with the same name as the function or command when a function with the \fB-u\fR attribute is referenced and when a command is not found. If an executable file with the name of that command is found, then it is read and executed in the current environment. Unlike \fBPATH\fR, the current directory must be represented explicitly by dot (\fB\&.\fR) rather than by adjacent colon (\fB:\fR) characters or a beginning or ending colon (\fB:\fR).
  1063 The search path for function definitions. The directories in this path are searched for a file with the same name as the function or command when a function with the \fB-u\fR attribute is referenced and when a command is not found. If an executable file with the name of that command is found, then it is read and executed in the current environment. Unlike \fBPATH\fR, the current directory must be represented explicitly by dot (\fB\&.\fR) rather than by adjacent colon (\fB:\fR) characters or a beginning or ending colon (\fB:\fR).
  1064 .RE
  1064 .RE
  1065 
  1065 
  1066 .sp
  1066 .sp
  1067 .ne 2
  1067 .ne 2
  1068 .mk
  1068 .mk
  1069 .na
  1069 .na
  1070 \fB\fBHISTCMD\fR\fR
  1070 \fB\fBHISTCMD\fR\fR
  1071 .ad
  1071 .ad
  1072 .RS 14n
  1072 .sp .6
  1073 .rt  
  1073 .RS 4n
  1074 The number of the current command in the history file.
  1074 The number of the current command in the history file.
  1075 .RE
  1075 .RE
  1076 
  1076 
  1077 .sp
  1077 .sp
  1078 .ne 2
  1078 .ne 2
  1079 .mk
  1079 .mk
  1080 .na
  1080 .na
  1081 \fB\fBHISTEDIT\fR\fR
  1081 \fB\fBHISTEDIT\fR\fR
  1082 .ad
  1082 .ad
  1083 .RS 14n
  1083 .sp .6
  1084 .rt  
  1084 .RS 4n
  1085 The name for the default editor name for the \fBhist\fR command.
  1085 The name for the default editor name for the \fBhist\fR command.
  1086 .RE
  1086 .RE
  1087 
  1087 
  1088 .sp
  1088 .sp
  1089 .ne 2
  1089 .ne 2
  1090 .mk
  1090 .mk
  1091 .na
  1091 .na
  1092 \fB\fBHISTFILE\fR\fR
  1092 \fB\fBHISTFILE\fR\fR
  1093 .ad
  1093 .ad
  1094 .RS 14n
  1094 .sp .6
  1095 .rt  
  1095 .RS 4n
  1096 If this variable is set when the shell is invoked, the value is the pathname of the file that is used to store the command history. See the \fBCommand Re-entry\fR section of this manual page. 
  1096 If this variable is set when the shell is invoked, the value is the pathname of the file that is used to store the command history. See the \fBCommand Re-entry\fR section of this manual page. 
  1097 .RE
  1097 .RE
  1098 
  1098 
  1099 .sp
  1099 .sp
  1100 .ne 2
  1100 .ne 2
  1101 .mk
  1101 .mk
  1102 .na
  1102 .na
  1103 \fB\fBHISTSIZE\fR\fR
  1103 \fB\fBHISTSIZE\fR\fR
  1104 .ad
  1104 .ad
  1105 .RS 14n
  1105 .sp .6
  1106 .rt  
  1106 .RS 4n
  1107 If this variable is set when the shell is invoked, then the number of previously entered commands that are accessible by this shell is greater than or equal to this number. The default is \fB512\fR.
  1107 If this variable is set when the shell is invoked, then the number of previously entered commands that are accessible by this shell is greater than or equal to this number. The default is \fB512\fR.
  1108 .RE
  1108 .RE
  1109 
  1109 
  1110 .sp
  1110 .sp
  1111 .ne 2
  1111 .ne 2
  1112 .mk
  1112 .mk
  1113 .na
  1113 .na
  1114 \fB\fBHOME\fR\fR
  1114 \fB\fBHOME\fR\fR
  1115 .ad
  1115 .ad
  1116 .RS 14n
  1116 .sp .6
  1117 .rt  
  1117 .RS 4n
  1118 The default argument (home directory) for the \fBcd\fR command.
  1118 The default argument (home directory) for the \fBcd\fR command.
  1119 .sp
  1119 .sp
  1120 \fBHOME\fR is not set by the shell. \fBHOME\fR is set by \fBlogin\fR(1).
  1120 \fBHOME\fR is not set by the shell. \fBHOME\fR is set by \fBlogin\fR(1).
  1121 .RE
  1121 .RE
  1122 
  1122 
  1124 .ne 2
  1124 .ne 2
  1125 .mk
  1125 .mk
  1126 .na
  1126 .na
  1127 \fB\fBIFS\fR\fR
  1127 \fB\fBIFS\fR\fR
  1128 .ad
  1128 .ad
  1129 .RS 14n
  1129 .sp .6
  1130 .rt  
  1130 .RS 4n
  1131 Internal field separators, normally SPACE, TAB, and NEWLINE that are used to separate the results of command substitution or parameter expansion and to separate fields with the built-in command read. The first character of the \fBIFS\fR variable is used to separate arguments for the \fB"$*"\fR substitution. See the \fBQuoting\fR section of this manual page. 
  1131 Internal field separators, normally SPACE, TAB, and NEWLINE that are used to separate the results of command substitution or parameter expansion and to separate fields with the built-in command read. The first character of the \fBIFS\fR variable is used to separate arguments for the \fB"$*"\fR substitution. See the \fBQuoting\fR section of this manual page. 
  1132 .sp
  1132 .sp
  1133 Each single occurrence of an \fBIFS\fR character in the string to be split, that is not in the \fBissspace\fR character class, and any adjacent characters in \fBIFS\fR that are in the \fBissspace\fR character class, delimit a field. One or more characters in IFS that belong to the \fBissspace\fR character class, delimit a field. In addition, if the same \fBissspace\fR character appears consecutively inside \fBIFS\fR, this character is treated as if it were not in the \fBissspace\fR class, so that if \fBIFS\fR consists of two tab characters, then two adjacent tab characters delimit a null field.
  1133 Each single occurrence of an \fBIFS\fR character in the string to be split, that is not in the \fBissspace\fR character class, and any adjacent characters in \fBIFS\fR that are in the \fBissspace\fR character class, delimit a field. One or more characters in IFS that belong to the \fBissspace\fR character class, delimit a field. In addition, if the same \fBissspace\fR character appears consecutively inside \fBIFS\fR, this character is treated as if it were not in the \fBissspace\fR class, so that if \fBIFS\fR consists of two tab characters, then two adjacent tab characters delimit a null field.
  1134 .sp
  1134 .sp
  1135 The shell specifies a default value to \fBIFS\fR.
  1135 The shell specifies a default value to \fBIFS\fR.
  1139 .ne 2
  1139 .ne 2
  1140 .mk
  1140 .mk
  1141 .na
  1141 .na
  1142 \fB\fBLANG\fR\fR
  1142 \fB\fBLANG\fR\fR
  1143 .ad
  1143 .ad
  1144 .RS 14n
  1144 .sp .6
  1145 .rt  
  1145 .RS 4n
  1146 This variable determines the locale category for any category not specifically selected with a variable starting with \fBLC_\fR or \fBLANG\fR.
  1146 This variable determines the locale category for any category not specifically selected with a variable starting with \fBLC_\fR or \fBLANG\fR.
  1147 .RE
  1147 .RE
  1148 
  1148 
  1149 .sp
  1149 .sp
  1150 .ne 2
  1150 .ne 2
  1151 .mk
  1151 .mk
  1152 .na
  1152 .na
  1153 \fB\fBLC_ALL\fR\fR
  1153 \fB\fBLC_ALL\fR\fR
  1154 .ad
  1154 .ad
  1155 .RS 14n
  1155 .sp .6
  1156 .rt  
  1156 .RS 4n
  1157 This variable overrides the value of the \fBLANG\fR variable and any other \fBLC_\fR variable.
  1157 This variable overrides the value of the \fBLANG\fR variable and any other \fBLC_\fR variable.
  1158 .RE
  1158 .RE
  1159 
  1159 
  1160 .sp
  1160 .sp
  1161 .ne 2
  1161 .ne 2
  1162 .mk
  1162 .mk
  1163 .na
  1163 .na
  1164 \fB\fBLC_COLLATE\fR\fR
  1164 \fB\fBLC_COLLATE\fR\fR
  1165 .ad
  1165 .ad
  1166 .RS 14n
  1166 .sp .6
  1167 .rt  
  1167 .RS 4n
  1168 This variable determines the locale category for character collation information.
  1168 This variable determines the locale category for character collation information.
  1169 .RE
  1169 .RE
  1170 
  1170 
  1171 .sp
  1171 .sp
  1172 .ne 2
  1172 .ne 2
  1173 .mk
  1173 .mk
  1174 .na
  1174 .na
  1175 \fB\fBLC_CTYPE\fR\fR
  1175 \fB\fBLC_CTYPE\fR\fR
  1176 .ad
  1176 .ad
  1177 .RS 14n
  1177 .sp .6
  1178 .rt  
  1178 .RS 4n
  1179 This variable determines the locale category for character handling functions. It determines the character classes for pattern matching. See the \fBFile Name Generation\fR section of this manual page.
  1179 This variable determines the locale category for character handling functions. It determines the character classes for pattern matching. See the \fBFile Name Generation\fR section of this manual page.
  1180 .RE
  1180 .RE
  1181 
  1181 
  1182 .sp
  1182 .sp
  1183 .ne 2
  1183 .ne 2
  1184 .mk
  1184 .mk
  1185 .na
  1185 .na
  1186 \fB\fBLC_NUMERIC\fR\fR
  1186 \fB\fBLC_NUMERIC\fR\fR
  1187 .ad
  1187 .ad
  1188 .RS 14n
  1188 .sp .6
  1189 .rt  
  1189 .RS 4n
  1190 This variable determines the locale category for the decimal point character.
  1190 This variable determines the locale category for the decimal point character.
  1191 .RE
  1191 .RE
  1192 
  1192 
  1193 .sp
  1193 .sp
  1194 .ne 2
  1194 .ne 2
  1195 .mk
  1195 .mk
  1196 .na
  1196 .na
  1197 \fB\fBLINES\fR\fR
  1197 \fB\fBLINES\fR\fR
  1198 .ad
  1198 .ad
  1199 .RS 14n
  1199 .sp .6
  1200 .rt  
  1200 .RS 4n
  1201 If this variable is set, the value is used to determine the column length for printing select lists. Select lists prints vertically until about two-thirds of \fBLINES\fR lines are filled.
  1201 If this variable is set, the value is used to determine the column length for printing select lists. Select lists prints vertically until about two-thirds of \fBLINES\fR lines are filled.
  1202 .RE
  1202 .RE
  1203 
  1203 
  1204 .sp
  1204 .sp
  1205 .ne 2
  1205 .ne 2
  1206 .mk
  1206 .mk
  1207 .na
  1207 .na
  1208 \fB\fBMAIL\fR\fR
  1208 \fB\fBMAIL\fR\fR
  1209 .ad
  1209 .ad
  1210 .RS 14n
  1210 .sp .6
  1211 .rt  
  1211 .RS 4n
  1212 If this variable is set to the name of a mail file \fBand\fR the \fBMAILPATH\fR variable is not set, then the shell informs the user of arrival of mail in the specified file.
  1212 If this variable is set to the name of a mail file \fBand\fR the \fBMAILPATH\fR variable is not set, then the shell informs the user of arrival of mail in the specified file.
  1213 .sp
  1213 .sp
  1214 \fBMAIL\fR is not set by the shell. On some systems, \fBMAIL\fR is set by \fBlogin\fR(1).
  1214 \fBMAIL\fR is not set by the shell. On some systems, \fBMAIL\fR is set by \fBlogin\fR(1).
  1215 .RE
  1215 .RE
  1216 
  1216 
  1218 .ne 2
  1218 .ne 2
  1219 .mk
  1219 .mk
  1220 .na
  1220 .na
  1221 \fB\fBMAILCHECK\fR\fR
  1221 \fB\fBMAILCHECK\fR\fR
  1222 .ad
  1222 .ad
  1223 .RS 14n
  1223 .sp .6
  1224 .rt  
  1224 .RS 4n
  1225 Specifies how often in seconds the shell checks for changes in the modification time of any of the files specified by the \fBMAILPATH\fR or \fBMAIL\fR variables. The default value is \fB600\fR seconds. When the time has elapsed the shell checks before issuing the next prompt.
  1225 Specifies how often in seconds the shell checks for changes in the modification time of any of the files specified by the \fBMAILPATH\fR or \fBMAIL\fR variables. The default value is \fB600\fR seconds. When the time has elapsed the shell checks before issuing the next prompt.
  1226 .sp
  1226 .sp
  1227 The shell specifies a default value to \fBMAILCHECK\fR.
  1227 The shell specifies a default value to \fBMAILCHECK\fR.
  1228 .RE
  1228 .RE
  1229 
  1229 
  1231 .ne 2
  1231 .ne 2
  1232 .mk
  1232 .mk
  1233 .na
  1233 .na
  1234 \fB\fBMAILPATH\fR\fR
  1234 \fB\fBMAILPATH\fR\fR
  1235 .ad
  1235 .ad
  1236 .RS 14n
  1236 .sp .6
  1237 .rt  
  1237 .RS 4n
  1238 A colon ( \fB:\fR ) separated list of file names. If this variable is set, then the shell informs the user of any modifications to the specified files that have occurred within the last \fBMAILCHECK\fR seconds. Each file name can be followed by a \fB?\fR and a message that is printed. The message undergoes parameter expansion, command substitution, and arithmetic substitution with the variable \fB$_\fR defined as the name of the file that has changed. The default message is \fByou have mail in $_\fR.
  1238 A colon ( \fB:\fR ) separated list of file names. If this variable is set, then the shell informs the user of any modifications to the specified files that have occurred within the last \fBMAILCHECK\fR seconds. Each file name can be followed by a \fB?\fR and a message that is printed. The message undergoes parameter expansion, command substitution, and arithmetic substitution with the variable \fB$_\fR defined as the name of the file that has changed. The default message is \fByou have mail in $_\fR.
  1239 .RE
  1239 .RE
  1240 
  1240 
  1241 .sp
  1241 .sp
  1242 .ne 2
  1242 .ne 2
  1243 .mk
  1243 .mk
  1244 .na
  1244 .na
  1245 \fB\fBPATH\fR\fR
  1245 \fB\fBPATH\fR\fR
  1246 .ad
  1246 .ad
  1247 .RS 14n
  1247 .sp .6
  1248 .rt  
  1248 .RS 4n
  1249 The search path for commands. Except in \fB\&.profile\fR, users cannot change \fBPATH\fR if executing under \fBrksh\fR. See the \fBExecution\fR section of this manual page.
  1249 The search path for commands. Except in \fB\&.profile\fR, users cannot change \fBPATH\fR if executing under \fBrksh\fR. See the \fBExecution\fR section of this manual page.
  1250 .sp
  1250 .sp
  1251 The shell specifies a default value to \fBPATH\fR.
  1251 The shell specifies a default value to \fBPATH\fR.
  1252 .RE
  1252 .RE
  1253 
  1253 
  1255 .ne 2
  1255 .ne 2
  1256 .mk
  1256 .mk
  1257 .na
  1257 .na
  1258 \fB\fBPS1\fR\fR
  1258 \fB\fBPS1\fR\fR
  1259 .ad
  1259 .ad
  1260 .RS 14n
  1260 .sp .6
  1261 .rt  
  1261 .RS 4n
  1262 The value of this variable is expanded for parameter expansion, command substitution, and arithmetic substitution to define the primary prompt string which by default is \fB$\fR. The character \fB!\fR in the primary prompt string is replaced by the command number. Two successive occurrences of \fB!\fR produces a single \fB!\fR when the prompt string is printed. See the \fBCommand Re-entry\fR section of this manual page.
  1262 The value of this variable is expanded for parameter expansion, command substitution, and arithmetic substitution to define the primary prompt string which by default is \fB$\fR. The character \fB!\fR in the primary prompt string is replaced by the command number. Two successive occurrences of \fB!\fR produces a single \fB!\fR when the prompt string is printed. See the \fBCommand Re-entry\fR section of this manual page.
  1263 .sp
  1263 .sp
  1264 The shell specifies a default value to \fBPS1\fR.
  1264 The shell specifies a default value to \fBPS1\fR.
  1265 .RE
  1265 .RE
  1266 
  1266 
  1268 .ne 2
  1268 .ne 2
  1269 .mk
  1269 .mk
  1270 .na
  1270 .na
  1271 \fB\fBPS2\fR\fR
  1271 \fB\fBPS2\fR\fR
  1272 .ad
  1272 .ad
  1273 .RS 14n
  1273 .sp .6
  1274 .rt  
  1274 .RS 4n
  1275 Secondary prompt string, by default, \fB>\fR.
  1275 Secondary prompt string, by default, \fB>\fR.
  1276 .sp
  1276 .sp
  1277 The shell specifies a default value to \fBPS2\fR.
  1277 The shell specifies a default value to \fBPS2\fR.
  1278 .RE
  1278 .RE
  1279 
  1279 
  1281 .ne 2
  1281 .ne 2
  1282 .mk
  1282 .mk
  1283 .na
  1283 .na
  1284 \fB\fBPS3\fR\fR
  1284 \fB\fBPS3\fR\fR
  1285 .ad
  1285 .ad
  1286 .RS 14n
  1286 .sp .6
  1287 .rt  
  1287 .RS 4n
  1288 Selection prompt string used within a select loop, by default \fB#?\fR.
  1288 Selection prompt string used within a select loop, by default \fB#?\fR.
  1289 .sp
  1289 .sp
  1290 The shell specifies a default value to \fBPS3\fR.
  1290 The shell specifies a default value to \fBPS3\fR.
  1291 .RE
  1291 .RE
  1292 
  1292 
  1294 .ne 2
  1294 .ne 2
  1295 .mk
  1295 .mk
  1296 .na
  1296 .na
  1297 \fB\fBPS4\fR\fR
  1297 \fB\fBPS4\fR\fR
  1298 .ad
  1298 .ad
  1299 .RS 14n
  1299 .sp .6
  1300 .rt  
  1300 .RS 4n
  1301 The value of this variable is expanded for parameter evaluation, command substitution, and arithmetic substitution and precedes each line of an execution trace. By default, \fBPS4\fR is \fB+\fR. When \fBPS4\fR is unset, the execution trace prompt is also \fB+\fR .
  1301 The value of this variable is expanded for parameter evaluation, command substitution, and arithmetic substitution and precedes each line of an execution trace. By default, \fBPS4\fR is \fB+\fR. When \fBPS4\fR is unset, the execution trace prompt is also \fB+\fR .
  1302 .sp
  1302 .sp
  1303 The shell specifies a default value to \fBPS4\fR.
  1303 The shell specifies a default value to \fBPS4\fR.
  1304 .RE
  1304 .RE
  1305 
  1305 
  1307 .ne 2
  1307 .ne 2
  1308 .mk
  1308 .mk
  1309 .na
  1309 .na
  1310 \fB\fBSHELL\fR\fR
  1310 \fB\fBSHELL\fR\fR
  1311 .ad
  1311 .ad
  1312 .RS 14n
  1312 .sp .6
  1313 .rt  
  1313 .RS 4n
  1314 The pathname of the shell is kept in the environment. At invocation, if the basename of this variable is \fBrsh\fR, \fBrksh\fR, \fBrksh\fR, or \fBkrsh\fR, the shell becomes restricted.
  1314 The pathname of the shell is kept in the environment. At invocation, if the basename of this variable is \fBrsh\fR, \fBrksh\fR, \fBrksh\fR, or \fBkrsh\fR, the shell becomes restricted.
  1315 .sp
  1315 .sp
  1316 \fBSHELL\fR is not set by the shell. On some systems, \fBSHELL\fR is set by \fBlogin\fR(1).
  1316 \fBSHELL\fR is not set by the shell. On some systems, \fBSHELL\fR is set by \fBlogin\fR(1).
  1317 .RE
  1317 .RE
  1318 
  1318 
  1320 .ne 2
  1320 .ne 2
  1321 .mk
  1321 .mk
  1322 .na
  1322 .na
  1323 \fB\fBTIMEFORMAT\fR\fR
  1323 \fB\fBTIMEFORMAT\fR\fR
  1324 .ad
  1324 .ad
  1325 .RS 14n
  1325 .sp .6
  1326 .rt  
  1326 .RS 4n
  1327 The value of this parameter is used as a format string specifying how the timing information for pipelines prefixed with the \fBtime\fR reserved word should be displayed. The \fB%\fR character introduces a format sequence that is expanded to a time value or other information. 
  1327 The value of this parameter is used as a format string specifying how the timing information for pipelines prefixed with the \fBtime\fR reserved word should be displayed. The \fB%\fR character introduces a format sequence that is expanded to a time value or other information. 
  1328 .sp
  1328 .sp
  1329 The format sequences and their meanings are as follows.
  1329 The format sequences and their meanings are as follows.
  1330 .sp
  1330 .sp
  1331 .ne 2
  1331 .ne 2
  1384 
  1384 
  1385 The braces denote optional portions. The optional \fIp\fR is a digit specifying the \fIprecision\fR, the number of fractional digits after a decimal point. A value of \fB0\fR causes no decimal point or fraction to be output. At most three places after the decimal point can be displayed. Values of \fIp\fR greater than \fB3\fR are treated as \fB3\fR. If \fIp\fR is not specified, the value \fB3\fR is used.
  1385 The braces denote optional portions. The optional \fIp\fR is a digit specifying the \fIprecision\fR, the number of fractional digits after a decimal point. A value of \fB0\fR causes no decimal point or fraction to be output. At most three places after the decimal point can be displayed. Values of \fIp\fR greater than \fB3\fR are treated as \fB3\fR. If \fIp\fR is not specified, the value \fB3\fR is used.
  1386 .sp
  1386 .sp
  1387 The optional \fBl\fR specifies a longer format, including hours if greater than zero, minutes, and seconds of the form \fIHHhMMmSS.FFs\fR. The value of \fIp\fR determines whether or not the fraction is included.
  1387 The optional \fBl\fR specifies a longer format, including hours if greater than zero, minutes, and seconds of the form \fIHHhMMmSS.FFs\fR. The value of \fIp\fR determines whether or not the fraction is included.
  1388 .sp
  1388 .sp
  1389 All other characters are output without change and a trailing NEWLINE is added. If unset, the default value, \fB$'\nreal\t%2lR\nuser\t%2lU\nsys%2lS'\fR, is used. If the value is null, no timing information is displayed.
  1389 All other characters are output without change and a trailing NEWLINE is added. If unset, the default value, \fB$'\enreal\et%2lR\enuser\et%2lU\ensys\et%2lS'\fR, is used. If the value is null, no timing information is displayed.
  1390 .RE
  1390 .RE
  1391 
  1391 
  1392 .sp
  1392 .sp
  1393 .ne 2
  1393 .ne 2
  1394 .mk
  1394 .mk
  1395 .na
  1395 .na
  1396 \fB\fBTMOUT\fR\fR
  1396 \fB\fBTMOUT\fR\fR
  1397 .ad
  1397 .ad
  1398 .RS 14n
  1398 .sp .6
  1399 .rt  
  1399 .RS 4n
  1400 If set to a value greater than zero, \fBTMOUT\fR is the default time-out value for the \fBread\fR built-in command. The \fBselect\fR compound command terminates after \fBTMOUT\fR seconds when input is from a terminal. Otherwise, the shell terminates if a line is not entered within the prescribed number of seconds while reading from a terminal. The shell can be compiled with a maximum bound for this value which cannot be exceeded.
  1400 If set to a value greater than zero, \fBTMOUT\fR is the default time-out value for the \fBread\fR built-in command. The \fBselect\fR compound command terminates after \fBTMOUT\fR seconds when input is from a terminal. Otherwise, the shell terminates if a line is not entered within the prescribed number of seconds while reading from a terminal. The shell can be compiled with a maximum bound for this value which cannot be exceeded.
  1401 .sp
  1401 .sp
  1402 The shell specifies a default value to \fBTMOUT\fR.
  1402 The shell specifies a default value to \fBTMOUT\fR.
  1403 .RE
  1403 .RE
  1404 
  1404 
  1406 .ne 2
  1406 .ne 2
  1407 .mk
  1407 .mk
  1408 .na
  1408 .na
  1409 \fB\fBVISUAL\fR\fR
  1409 \fB\fBVISUAL\fR\fR
  1410 .ad
  1410 .ad
  1411 .RS 14n
  1411 .sp .6
  1412 .rt  
  1412 .RS 4n
  1413 If the value of this variable matches the pattern \fB*[Vv][Ii]*\fR, then the \fBvi\fR option is turned on. See \fBSpecial Commands\fR. If the value matches the pattern \fB*gmacs*\fR , the \fBgmacs\fR option is turned on. If the value matches the pattern \fB*macs*\fR, then the \fBemacs\fR option is turned on. The value of \fBVISUAL\fR overrides the value of \fBEDITOR\fR.
  1413 If the value of this variable matches the pattern \fB*[Vv][Ii]*\fR, then the \fBvi\fR option is turned on. See \fBSpecial Commands\fR. If the value matches the pattern \fB*gmacs*\fR , the \fBgmacs\fR option is turned on. If the value matches the pattern \fB*macs*\fR, then the \fBemacs\fR option is turned on. The value of \fBVISUAL\fR overrides the value of \fBEDITOR\fR.
  1414 .RE
  1414 .RE
  1415 
  1415 
  1416 .SS "Field Splitting"
  1416 .SS "Field Splitting"
  1417 .sp
  1417 .sp
  1846 Treat the match as case insensitive. 
  1846 Treat the match as case insensitive. 
  1847 .RE
  1847 .RE
  1848 
  1848 
  1849 .sp
  1849 .sp
  1850 .LP
  1850 .LP
  1851 If both \fIoptions\fR and \fB:\fR\fIpattern-list\fR are specified, then the options apply only to \fIpattern-list\fR. Otherwise, the options remain in effect until they are disabled by a subsequent \fB~(...)\fR or at the end of the sub-pattern containing \fB~(...)\fR.
       
  1852 .sp
       
  1853 .LP
       
  1854 Each of the metacharacters listed in the \fBDefinitions\fR section of this manual page has a special meaning to the shell and causes termination of a word unless quoted. A character can be quoted, that is, made to stand for itself, by preceding it with a backslash (\fB\e\fR). The pair \fB\e\fRNEWLINE is removed. All characters enclosed between a pair of single quote marks (\fB\&''\fR) that is not preceded by a \fB$\fR are quoted. A single quote cannot appear within the single quotes. A single quoted string preceded by an unquoted \fB$\fR is processed as an \fBANSI-C\fR string except for the following:
  1851 Each of the metacharacters listed in the \fBDefinitions\fR section of this manual page has a special meaning to the shell and causes termination of a word unless quoted. A character can be quoted, that is, made to stand for itself, by preceding it with a backslash (\fB\e\fR). The pair \fB\e\fRNEWLINE is removed. All characters enclosed between a pair of single quote marks (\fB\&''\fR) that is not preceded by a \fB$\fR are quoted. A single quote cannot appear within the single quotes. A single quoted string preceded by an unquoted \fB$\fR is processed as an \fBANSI-C\fR string except for the following:
  1855 .sp
  1852 .sp
  1856 .ne 2
  1853 .ne 2
  1857 .mk
  1854 .mk
  1858 .na
  1855 .na
  1907 Equivalent to the escape character (\fBASCII\fR 033),
  1904 Equivalent to the escape character (\fBASCII\fR 033),
  1908 .RE
  1905 .RE
  1909 
  1906 
  1910 .sp
  1907 .sp
  1911 .LP
  1908 .LP
  1912 Inside double quote marks (\fB""\fR), parameter and command substitution occur and \fB\e\fR quotes the characters \fB\e\fR, \fB`\fR, \fB"\fR, and \fB$\fR. A \fB$\fR in front of a double quoted string is ignored in the \fBC\fR or \fBPOSIX\fR locale, and might cause the string to be replaced by a locale specific string otherwise. The meaning of \fB$*\fR and \fB$@\fR is identical when not quoted or when used as a variable assignment value or as a file name. However, when used as a command argument, \fB"$*"\fR is equivalent to \fB"$1\fId\fR$2\fId\fR..."\fR, where \fId\fR is the first character of the IFS variable, whereas \fB"$@"\fR is equivalent to \fB"$1" "$2" ....\fR Inside grave quote marks (\fB``\fR), \fB\\fR quotes the characters \fB\e\fR, \fB`\fR, and \fB$\fR. If the grave quotes occur within double quotes, then \fB\e\fR also quotes the character \fB"\fR.
  1909 Inside double quote marks (\fB""\fR), parameter and command substitution occur and \fB\e\fR quotes the characters \fB\e\fR, \fB`\fR, \fB"\fR, and \fB$\fR. A \fB$\fR in front of a double quoted string is ignored in the \fBC\fR or \fBPOSIX\fR locale, and might cause the string to be replaced by a locale specific string otherwise. The meaning of \fB$*\fR and \fB$@\fR is identical when not quoted or when used as a variable assignment value or as a file name. However, when used as a command argument, \fB"$*"\fR is equivalent to \fB"$1\fId\fR$2\fId\fR..."\fR, where \fId\fR is the first character of the IFS variable, whereas \fB"$@"\fR is equivalent to \fB"$1" "$2" ....\fR Inside grave quote marks (\fB``\fR), \fB\e\fR quotes the characters \fB\e\fR, \fB`\fR, and \fB$\fR. If the grave quotes occur within double quotes, then \fB\e\fR also quotes the character \fB"\fR.
  1913 .sp
  1910 .sp
  1914 .LP
  1911 .LP
  1915 The special meaning of reserved words or aliases can be removed by quoting any character of the reserved word. The recognition of function names or built-in command names cannot be altered by quoting them.
  1912 The special meaning of reserved words or aliases can be removed by quoting any character of the reserved word. The recognition of function names or built-in command names cannot be altered by quoting them.
  1916 .SS "Arithmetic Evaluation"
  1913 .SS "Arithmetic Evaluation"
  1917 .sp
  1914 .sp
  5391 .na
  5388 .na
  5392 \fB\fB-p\fR\fR
  5389 \fB\fB-p\fR\fR
  5393 .ad
  5390 .ad
  5394 .sp .6
  5391 .sp .6
  5395 .RS 4n
  5392 .RS 4n
  5396 Disables processing of the \fB$HOME/.profile\fR file and uses the file \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is on whenever the effective \fBuid\fR (\fBgid\fR) is not equal to the real \fBuid\fR (\fBgid\fR). Turning this off causes the effective \fBuid\fR and \fBgid\fR to be set to the real \fBuid\fR and \fBgid\fR.
  5393 Disables processing of the \fB$HOME/.profile\fR file and uses the file \fB/etc/suid_profile\fR instead of the \fBENV\fR file. This mode is required if the effective \fBuid\fR is not equal to the real uid and you do not want the default behavior of setting the effective to be the same as the real uid. Turning this off causes the effective \fBuid\fR and \fBgid\fR to be set to the real \fBuid\fR and \fBgid\fR.
  5397 .RE
  5394 .RE
  5398 
  5395 
  5399 .sp
  5396 .sp
  5400 .ne 2
  5397 .ne 2
  5401 .mk
  5398 .mk
  5936 .RE
  5933 .RE
  5937 
  5934 
  5938 .SS "Invocation"
  5935 .SS "Invocation"
  5939 .sp
  5936 .sp
  5940 .LP
  5937 .LP
  5941 If the shell is invoked by \fBexec\fR(2), and the first character of argument zero (\fB$0\fR) is \fB-\fR, then the shell is assumed to be a login shell and commands are read from \fB/etc/profile\fR and then from \fB$HOME/.profile\fR. Next, for interactive shells, commands are read first from \fB/etc/ksh.kshrc\fR, and then from the file named by performing parameter expansion, command substitution, and arithmetic substitution on the value of the environment variable \fBENV\fR if the file exists. If the \fB-s\fR option is not present and \fIarg\fR and a file by the name of \fIarg\fR exists, then it reads and executes this script. Otherwise, if the first \fIarg\fR does not contain a \fB/\fR, a path search is performed on the first \fIarg\fR to determine the name of the script to execute. The script \fIarg\fR must have execute permission and any \fBsetuid\fR and \fBsetgid\fR settings are ignored. If the script is not found on the path, \fIarg\fR is processed as if it named a built-in command or function. 
  5938 If the shell is invoked by \fBexec\fR(2), and the first character of argument zero (\fB$0\fR) is \fB-\fR, then the shell is assumed to be a login shell and commands are read from \fB/etc/profile\fR and then from either .\fBprofile\fR in the current directory or \fB$HOME/.profile\fR, if either file exists. Next, for interactive shells, commands are read first from \fB/etc/ksh.kshrc\fR, and then from the file named by performing parameter expansion, command substitution, and arithmetic substitution on the value of the environment variable \fBENV\fR if the file exists. If the \fB-s\fR option is not present and \fIarg\fR and a file by the name of \fIarg\fR exists, then it reads and executes this script. Otherwise, if the first \fIarg\fR does not contain a \fB/\fR, a path search is performed on the first \fIarg\fR to determine the name of the script to execute. The script \fIarg\fR must have execute permission and any \fBsetuid\fR and \fBsetgid\fR settings are ignored. If the script is not found on the path, \fIarg\fR is processed as if it named a built-in command or function. 
  5942 .sp
  5939 .sp
  5943 .LP
  5940 .LP
  5944 Commands are then read as described, and the following options are interpreted by the shell when it is invoked:
  5941 Commands are then read as described, and the following options are interpreted by the shell when it is invoked:
  5945 .sp
  5942 .sp
  5946 .ne 2
  5943 .ne 2
  6064 .LP
  6061 .LP
  6065 These restrictions are enforced after .\fBprofile\fR and the \fBENV\fR files are interpreted.
  6062 These restrictions are enforced after .\fBprofile\fR and the \fBENV\fR files are interpreted.
  6066 .sp
  6063 .sp
  6067 .LP
  6064 .LP
  6068 When a command to be executed is found to be a shell procedure, \fBrksh\fR invokes \fBksh\fR to execute it. Thus, it is possible to provide to the end-user shell procedures that have access to the full power of the standard shell, while imposing a limited menu of commands. This scheme assumes that the end-user does not have write and execute permissions in the same directory. The net effect of these rules is that the writer of the .\fBprofile\fR has complete control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands, for example, \fB/usr/rbin\fR, that can be safely invoked by \fBrksh\fR. 
  6065 When a command to be executed is found to be a shell procedure, \fBrksh\fR invokes \fBksh\fR to execute it. Thus, it is possible to provide to the end-user shell procedures that have access to the full power of the standard shell, while imposing a limited menu of commands. This scheme assumes that the end-user does not have write and execute permissions in the same directory. The net effect of these rules is that the writer of the .\fBprofile\fR has complete control over user actions, by performing guaranteed setup actions and leaving the user in an appropriate directory (probably not the login directory). The system administrator often sets up a directory of commands, for example, \fB/usr/rbin\fR, that can be safely invoked by \fBrksh\fR. 
  6069 .SH USAGE
       
  6070 .sp
       
  6071 .LP
       
  6072 See \fBlargefile\fR(5) for the description of the behavior of \fBksh\fR and \fBrksh\fR when encountering files greater than or equal to 2 Gbyte (2^31 bytes).
       
  6073 .SH EXIT STATUS
  6066 .SH EXIT STATUS
  6074 .sp
  6067 .sp
  6075 .LP
  6068 .LP
  6076 The following exit values are returned:
  6069 The following exit values are returned:
  6077 .sp
  6070 .sp
  6196 .LP
  6189 .LP
  6197 The scripting interface is Uncommitted. The environment variables, \fB\&.paths\fR feature, and editing modes are Volatile.
  6190 The scripting interface is Uncommitted. The environment variables, \fB\&.paths\fR feature, and editing modes are Volatile.
  6198 .SH SEE ALSO
  6191 .SH SEE ALSO
  6199 .sp
  6192 .sp
  6200 .LP
  6193 .LP
  6201 \fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1), \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1), \fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBprintf\fR(1), \fBshell_builtins\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2), \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C), \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
  6194 \fBcat\fR(1), \fBcd\fR(1), \fBchmod\fR(1), \fBcut\fR(1), \fBdate\fR(1), \fBegrep\fR(1), \fBecho\fR(1), \fBegrep\fR(1), \fBenv\fR(1), \fBfgrep\fR(1), \fBgrep\fR(1), \fBlogin\fR(1), \fBnewgrp\fR(1), \fBpaste\fR(1), \fBprintf\fR(1), \fBshell_builtins\fR(1), \fBstty\fR(1), \fBtest\fR(1), \fBumask\fR(1), \fBvi\fR(1), \fBdup\fR(2), \fBexec\fR(2), \fBfork\fR(2), \fBioctl\fR(2), \fBlseek\fR(2), \fBpathconf\fR(2), \fBpipe\fR(2), \fBsysconf\fR(3C), \fBulimit\fR(2), \fBumask\fR(2), \fBrand\fR(3C), \fBtcgetattr\fR(3C), \fBwait\fR(3C), \fBa.out\fR(4), \fBprofile\fR(4), \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)
  6202 .sp
  6195 .sp
  6203 .LP
  6196 .LP
  6204 Bolsky, Morris I. and Korn, David G., \fIThe New KornShell Command and Programming Language\fR, Prentice Hall, 1995.
  6197 Bolsky, Morris I. and Korn, David G., \fIThe New KornShell Command and Programming Language\fR, Prentice Hall, 1995.
  6205 .sp
  6198 .sp
  6206 .LP
  6199 .LP