Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 72 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
72
Dung lượng
566,26 KB
Nội dung
touch – change file access and modification times /usr/ucb/touch [-acfm] file… touch sets the access and modification times of each file to the current time. file is created if it does not already exist. -a Change the access time of file. Do not change the modification time unless -m is also specified. -c Do not create file if it does not exist. -f Attempt to force the touch in spite of read and write permissions on file. -m Change the modification time of file. Do not change the access time unless -a is also specified. See largefile(5) for the description of the behavior of touch when encountering files greater than or equal to 2 Gbyte ( 2 31 bytes). The following exit values are returned: 0 touch executed successfully and all requested changes were made. >0 An error occurred. touch returns the number of files for which the times could not be successfully modified. See attributes(5) for descriptions of the following attributes: ATTRIBUTE TYPE ATTRIBUTE VALUE Availability SUNWscpu touch(1), attributes(5), largefile(5) touch(1B) NAME SYNOPSIS DESCRIPTION OPTIONS USAGE EXIT STATUS ATTRIBUTES SEE ALSO 1558 man pages section 1: User Commands • Last Revised 26 Oct 1995 tplot, t300, t300s, t4014, t450, tek, ver – graphics filters for various plotters /usr/bin/tplot [-T terminal] tplot reads plotting instructions from the standard input and produces plotting instructions suitable for a particular terminal on the standard output. If no terminal is specified, the environment variable TERM is used. The default terminal is tek. Except for ver, the following terminal-types can be used with ‘lpr -g’ (see lpr)to produce plotted output: 300 DASI 300 or GSI terminal (Diablo® mechanism). 300s | 300S DASI 300s terminal (Diablo mechanism). 450 DASI Hyterm 450 terminal (Diablo mechanism). 4014 | tek Tektronix 4014 and 4015 storage scope with Enhanced Graphics Module. (Use 4013 for Tektronix 4014 or 4015 without the Enhanced Graphics Module). ver Versatec® D1200A printer-plotter. The output is scan-converted and suitable input to ‘lpr -v’. /usr/lib/t300 /usr/lib/t300s /usr/lib/t4014 /usr/lib/t450 /usr/lib/tek /usr/lib/vplot See attributes(5) for descriptions of the following attributes: ATTRIBUTE TYPE ATTRIBUTE VALUE Availability SUNWcsu lp(1), vi(1), attributes(5) tplot(1) NAME SYNOPSIS DESCRIPTION ENVIRONMENT VARIABLES FILES ATTRIBUTES SEE ALSO User Commands 1559 tput – initialize a terminal or query terminfo database tput [-T type] capname [parm…] tput -S << tput uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell (see sh(1)); to clear, initialize or reset the terminal; or to return the long name of the requested terminal type. tput outputs a string if the capability attribute (capname) is of type string, or an integer if the attribute is of type integer. If the attribute is of type boolean, tput simply sets the exit status (0 for TRUE if the terminal has the capability, 1 for FALSE if it does not), and produces no output. Before using a value returned on standard output, the user should test the exit status ($?, see sh(1)) to be sure it is 0. See the EXIT STATUS section. The following options are supported: -Ttype Indicates the type of terminal. Normally this option is unnecessary, because the default is taken from the environment variable TERM.If-T is specified, then the shell variables LINES and COLUMNS and the layer size will not be referenced. -S Allows more than one capability per invocation of tput. The capabilities must be passed to tput from the standard input instead of from the command line (see the example in the EXAMPLES section). Only one capname is allowed per line. The -S option changes the meaning of the 0 and 1 boolean and string exit statuses (see the EXIT STATUS section). The following operands are supported: capname Indicates the capability attribute from the terminfo database. See terminfo(4) for a complete list of capabilities and the capname associated with each. The following strings will be supported as operands by the implementation in the "C" locale: clear Display the clear-screen sequence. init If the terminfo database is present and an entry for the user’s terminal exists (see -Ttype, above), the following will occur: 1. if present, the terminal’s initialization strings will be output (is1, is2, is3, if, iprog), 2. any delays (for instance, newline) specified in the entry will be set in the tty driver, tput(1) NAME SYNOPSIS DESCRIPTION OPTIONS OPERANDS 1560 man pages section 1: User Commands • Last Revised 1 Feb 1995 3. tabs expansion will be turned on or off according to the specification in the entry, and 4. if tabs are not expanded, standard tabs will be set (every 8 spaces). If an entry does not contain the information needed for any of the four above activities, that activity will silently be skipped. reset Instead of putting out initialization strings, the terminal’s reset strings will be output if present (rs1, rs2, rs3, rf). If the reset strings are not present, but initialization strings are, the initialization strings will be output. Otherwise, reset acts identically to init. longname If the terminfo database is present and an entry for the user’s terminal exists (see -Ttype above), then the long name of the terminal will be put out. The long name is the last name in the first line of the terminal’s description in the terminfo database (see term(5)). parm If the attribute is a string that takes parameters, the argument parm will be instantiated into the string. An all numeric argument will be passed to the attribute as a number. EXAMPLE 1 Using the tput command. This example initializes the terminal according to the type of terminal in the environment variable TERM. This command should be included in everyone’s .profile after the environment variable TERM has been exported, as illustrated on the profile(4) manual page. example% tput init The next example resets an AT&T 5620 terminal, overriding the type of terminal in the environment variable TERM: example% tput -T5620 reset The following example sends the sequence to move the cursor to row 0, column 0 (the upper left corner of the screen, usually known as the "home" cursor position). example% tput cup 0 0 The next example echos the clear-screen sequence for the current terminal. example% tput clear The next command prints the number of columns for the current terminal. example% tput cols The following command prints the number of columns for the 450 terminal. tput(1) EXAMPLES User Commands 1561 EXAMPLE 1 Using the tput command. (Continued) example% tput -T450 cols The next example sets the shell variables bold, to begin stand-out mode sequence, and offbold, to end standout mode sequence, for the current terminal. This might be followed by a prompt: echo "${bold}Please type in your name: ${offbold}\c" example% bold=’tput smso’ example% offbold=’tput rmso’ This example sets the exit status to indicate if the current terminal is a hardcopy terminal. example% tput hc This next example sends the sequence to move the cursor to row 23, column 4. example% tput cup 23 4 The next command prints the long name from the terminfo database for the type of terminal specified in the environment variable TERM. example% tput longname This last example shows tput processing several capabilities in one invocation. This example clears the screen, moves the cursor to position 10, 10 and turns on bold (extra bright) mode. The list is terminated by an exclamation mark (!) on a line by itself. example% tput -S <<! > clear > cup 10 10 > bold >! See environ(5) for descriptions of the following environment variables that affect the execution of tput: LC_CTYPE, LC_MESSAGES, and NLSPATH. TERM Determine the terminal type. If this variable is unset or null, and if the -T option is not specified, an unspecified default terminal type will be used. The following exit values are returned: 0 ■ If capname is of type boolean and -S is not specified, indicates TRUE. ■ If capname is of type string and -S is not specified, indicates capname is defined for this terminal type. ■ If capname is of type boolean or string and -S is specified, indicates that all lines were successful. ■ capname is of type integer. ■ The requested string was written successfully. 1 ■ If capname is of type boolean and -S is not specified, indicates FALSE. tput(1) ENVIRONMENT VARIABLES EXIT STATUS 1562 man pages section 1: User Commands • Last Revised 1 Feb 1995 ■ If capname is of type string and -S is not specified, indicates that capname is not defined for this terminal type. 2 Usage error. 3 No information is available about the specified terminal type. 4 The specified operand is invalid. >4 An error occurred. −1 capname is a numeric variable that is not specified in the terminfo database; for instance, tput -T450 lines and tput -T2621 xmc. /usr/include/curses.h curses(3CURSES) header /usr/include/term.h terminfo header /usr/lib/tabset/* tab settings for some terminals, in a format appropriate to be output to the terminal (escape sequences that set margins and tabs); for more information, see the "Tabs and Initialization" section of terminfo(4) /usr/share/lib/terminfo/?/* compiled terminal description database See attributes(5) for descriptions of the following attributes: ATTRIBUTE TYPE ATTRIBUTE VALUE Availability SUNWcsu clear(1), sh(1), stty(1), tabs(1), curses(3CURSES), profile(4), terminfo(4), attributes(5), environ(5), term(5) tput(1) FILES ATTRIBUTES SEE ALSO User Commands 1563 tr – translate characters /usr/bin/tr [-cs] string1 string2 /usr/bin/tr -s | -d [-c] string1 /usr/bin/tr -ds [-c] string1 string2 /usr/xpg4/bin/tr [-cs] string1 string2 /usr/xpg4/bin/tr -s | -d [-c] string1 /usr/bin/xpg4/tr -ds [-c] string1 string2 The tr utility copies the standard input to the standard output with substitution or deletion of selected characters. The options specified and the string1 and string2 operands control translations that occur while copying characters and single-character collating elements. The following options are supported: -c Complements the set of characters specified by string1. -d Deletes all occurrences of input characters that are specified by string1. -s Replaces instances of repeated characters with a single character. When the -d option is not specified: ■ Each input character found in the array specified by string1 is replaced by the character in the same relative position in the array specified by string2. When the array specified by string2 is shorter that the one specified by string1, the results are unspecified. ■ If the -c option is specified, the complements of the characters specified by string1 (the set of all characters in the current character set, as defined by the current setting of LC_CTYPE, except for those actually specified in the string1 operand) are placed in the array in ascending collation sequence, as defined by the current setting of LC_COLLATE. ■ Because the order in which characters specified by character class expressions or equivalence class expressions is undefined, such expressions should only be used if the intent is to map several characters into one. An exception is case conversion, as described previously. When the -d option is specified: ■ Input characters found in the array specified by string1 will be deleted. ■ When the -c option is specified with -d, all characters except those specified by string1 will be deleted. The contents of string2 will be ignored, unless the -s option is also specified. ■ The same string cannot be used for both the -d and the -s option; when both options are specified, both string1 (used for deletion) and string2 (used for squeezing) are required. tr(1) NAME SYNOPSIS DESCRIPTION OPTIONS 1564 man pages section 1: User Commands • Last Revised 1 Jun 2001 When the -s option is specified, after any deletions or translations have taken place, repeated sequences of the same character will be replaced by one occurrence of the same character, if the character is found in the array specified by the last operand. If the last operand contains a character class, such as the following example: tr -s ’[:space:]’ the last operand’s array will contain all of the characters in that character class. However, in a case conversion, as described previously, such as tr -s ’[:upper:]’’[:lower:]’ the last operand’s array will contain only those characters defined as the second characters in each of the toupper or tolower character pairs, as appropriate. (See toupper(3C) and tolower(3C)). An empty string used for string1 or string2 produces undefined results. The following operands are supported: string1 string2 Translation control strings. Each string represents a set of characters to be converted into an array of characters used for the translation. The operands string1 and string2 (if specified) define two arrays of characters. The constructs in the following list can be used to specify characters or single-character collating elements. If any of the constructs result in multi-character collating elements, tr will exclude, without a diagnostic, those multi-character elements from the resulting array. character Any character not described by one of the conventions below represents itself. \ octal Octal sequences can be used to represent characters with specific coded values. An octal sequence consists of a backslash followed by the longest sequence of one-, two-, or three-octal-digit characters (01234567). The sequence causes the character whose encoding is represented by the one-, two- or three-digit octal integer to be placed into the array. Multi-byte characters require multiple, concatenated escape sequences of this type, including the leading \ for each byte. \ character The backslash-escape sequences \a, \b, \f, \n, \r, \t, and \v are supported. The results of using any other character, other than an octal digit, following the backslash are unspecified. tr(1) OPERANDS User Commands 1565 c-c [ c-c ] Represents the range of collating elements between the range endpoints, inclusive, as defined by the current setting of the LC_COLLATE locale category. The starting endpoint must precede the second endpoint in the current collation order. The characters or collating elements in the range are placed in the array in ascending collation sequence. [:class:] Represents all characters belonging to the defined character class, as defined by the current setting of the LC_CTYPE locale category. The following character class names will be accepted when specified in string1: alnum blank digit lower punct upper alpha cntrl graph print space xdigit In addition, character class expressions of the form [:name:] are recognized in those locales where the name keyword has been given a charclass definition in the LC_CTYPE category. Note: /usr/bin/tr supports character class expressions only in singlebyte locales. Use /usr/xpg4/bin/tr to support these expressions in any locale. When both the -d and -s options are specified, any of the character class names will be accepted in string2. Otherwise, only character class names lower or upper are valid in string2 and then only if the corresponding character class upper and lower, respectively, is specified in the same relative position in string1. Such a specification is interpreted as a request for case conversion. When [:lower:] appears in string1 and [:upper:] appears in string2, the arrays will contain the characters from the toupper mapping in the LC_CTYPE category of the current locale. When [:upper:] appears in string1 and [:lower:] appears in string2, the arrays will contain the characters from the tolower mapping in the LC_CTYPE category of the current locale. The first character from each mapping pair will be in the array for string1 and the second character from each mapping pair will be in the array for string2 in the same relative position. Except for case conversion, the characters specified by a character class expression are placed in the array in an unspecified order. If the name specified for class does not define a valid character class in the current locale, the behavior is undefined. [=equiv=] Represents all characters or collating elements belonging to the same equivalence class as equiv,asdefined by the current setting of the LC_COLLATE locale category. An equivalence class expression tr(1) /usr/xpg4/bin/tr /usr/bin/tr 1566 man pages section 1: User Commands • Last Revised 1 Jun 2001 is allowed only in string1,orinstring2 when it is being used by the combined -d and -s options. The characters belonging to the equivalence class are placed in the array in an unspecified order. [x*n] Represents n repeated occurrences of the character x. Because this expression is used to map multiple characters to one, it is only valid when it occurs in string2.Ifn is omitted or is 0,itis interpreted as large enough to extend the string2-based sequence to the length of the string1-based sequence. If n has a leading 0,it is interpreted as an octal value. Otherwise, it is interpreted as a decimal value. See largefile(5) for the description of the behavior of tr when encountering files greater than or equal to 2 Gbyte ( 2 31 bytes). EXAMPLE 1 Creating a list of words The following example creates a list of all words in file1, one per line in file2, where a word is taken to be a maximal string of letters. tr −cs "[:alpha:]" "[\n*]" <file1 >file2 EXAMPLE 2 Translating characters This example translates all lower-case characters in file1 to upper-case and writes the results to standard output. tr "[:lower:]" "[:upper:]" <file1 Notice that the caveat expressed in the corresponding example in XPG3 is no longer in effect. This case conversion is now a special case that employs the tolower and toupper classifications, ensuring that proper mapping is accomplished (when the locale is correctly defined). EXAMPLE 3 Identifying equivalent characters This example uses an equivalence class to identify accented variants of the base character e in file1, which are stripped of diacritical marks and written to file2. tr "[=e=]" e <file1 >file2 See environ(5) for descriptions of the following environment variables that affect the execution of tr: LC_COLLATE, LC_CTYPE, LC_MESSAGES, and NLSPATH. The following exit values are returned: 0 All input was processed successfully. >0 An error occurred. tr(1) USAGE EXAMPLES ENVIRONMENT VARIABLES EXIT STATUS User Commands 1567 [...]... calls This example traces all user- level calls to functions in the printf and scanf family contained in the C library: 1580 man pages section 1: User Commands • Last Revised 15 Jul 199 8 truss(1) EXAMPLE 8 Tracing printf and scanf function calls example$ truss -u ’libc : *printf,*scanf’ EXAMPLE 9 (Continued) Tracing any user- level function call This example traces every user- level function call from... any command whose object file (a.out) cannot be read by a user cannot be traced by that user; set-uid and set-gid commands can be traced only by a privileged user Unless it is run by a privileged user, truss loses control of any process that performs an exec() of a set-id or unreadable object file; such processes continue normally, though independently of truss, from the point of the exec() User Commands... TYPE Availability SEE ALSO 1588 lorder(1), attributes(5), environ(5) man pages section 1: User Commands • Last Revised 1 Feb 199 5 ATTRIBUTE VALUE SUNWbtool tsort(1) DIAGNOSTICS Odd data: there are an odd number of fields in the input file User Commands 15 89 tty(1) NAME SYNOPSIS DESCRIPTION OPTIONS tty – return user s terminal name tty [-l] [-s] The tty utility writes to the standard output the name of... exiting This enables the user to terminate excessive trace output and to release previously-existing processes Released processes continue normally, as though they had never been touched EXAMPLES EXAMPLE 1 Tracing a command This example produces a trace of the find(1) command on the terminal: example$ truss find -print >find.out User Commands 15 79 truss(1) EXAMPLE 1 Tracing a command (Continued) EXAMPLE... being traced For the example of the spell command shown above, spell itself uses 9 process slots, one for the shell and 8 for the 8-member pipeline, while truss adds another 9 processes, for a total of 18 Not all possible structures passed in all possible system calls are displayed under the -v option 1582 man pages section 1: User Commands • Last Revised 15 Jul 199 8 tset(1B) NAME SYNOPSIS tset, reset... OPTIONS Output commands to set and export TERM This can be used with set noglob eval ‘tset -s ‘ unset noglob 1584 man pages section 1: User Commands • Last Revised 15 Feb 199 5 tset(1B) to bring the terminal information into the environment Doing so makes programs such as vi(1) start up faster If the SHELL environment variable ends with csh, C shell commands are output, otherwise Bourne shell commands are... 1: User Commands • Last Revised 15 Feb 199 5 tset(1B) EXAMPLE 4 FILES Selecting a terminal with specific settings (Continued) login profile /etc/termcap ATTRIBUTES See attributes(5) for descriptions of the following attributes: ATTRIBUTE TYPE Availability SEE ALSO NOTES ATTRIBUTE VALUE SUNWscpu csh(1), sh(1), stty(1), vi(1), attributes(5), environ(5) The tset command is one of the first commands a user. .. commands it invokes If sig is ERR then arg will be executed whenever a command has a non-zero exit status If sig is DEBUG then arg will be executed after each command If sig is 0 or EXIT for a trap set outside any function then the command arg is executed on exit from the shell The trap command with no arguments prints a list of commands associated with each signal number On this man page, ksh(1) commands... NOTES 1 590 The -s option is useful only if the exit status is wanted It does not rely on the ability to form a valid path name Portable applications should use test -t man pages section 1: User Commands • Last Revised 1 Feb 199 5 type(1) NAME SYNOPSIS DESCRIPTION type – write a description of command type type name… The type utility indicates how each name operand would be interpreted if used as a command. .. override previous ones (those to the left) -p Interprets the command arguments to truss as a list of process-ids for existing processes (see ps(1)) rather than as a command to be executed truss takes control of each process and begins tracing it provided that the userid and groupid of the process match those of the user or that the user is a privileged user Processes may also be specified by their names in . largefile(5) touch(1B) NAME SYNOPSIS DESCRIPTION OPTIONS USAGE EXIT STATUS ATTRIBUTES SEE ALSO 1558 man pages section 1: User Commands • Last Revised 26 Oct 199 5 tplot, t300, t300s, t4014, t450, tek, ver – graphics filters for various plotters /usr/bin/tplot. driver, tput(1) NAME SYNOPSIS DESCRIPTION OPTIONS OPERANDS 1560 man pages section 1: User Commands • Last Revised 1 Feb 199 5 3. tabs expansion will be turned on or off according to the specification in. clear The next command prints the number of columns for the current terminal. example% tput cols The following command prints the number of columns for the 450 terminal. tput(1) EXAMPLES User Commands