User Commands awk(1) NAME awk - pattern scanning and processing language SYNOPSIS /usr/bin/awk [-f progfile] [-Fc] [ ' prog '] [parameters] [filename...] /usr/xpg4/bin/awk [-FcERE] [-v assignment...] 'program' -f progfile... [argument...] DESCRIPTION The /usr/xpg4/bin/awk utility is described on the nawk(1) manual page. The /usr/bin/awk utility scans each input filename for lines that match any of a set of patterns specified in prog. The prog string must be enclosed in single quotes ( ') to pro- tect it from the shell. For each pattern in prog there can be an associated action performed when a line of a filename matches the pattern. The set of pattern-action statements can appear literally as prog or in a file specified with the -f progfile option. Input files are read in order; if there are no files, the standard input is read. The file name '-' means the standard input. OPTIONS The following options are supported: -f progfile awk uses the set of patterns it reads from progfile. -Fc Uses the character c as the field separator (FS) character. See the discussion of FS below. USAGE Input Lines Each input line is matched against the pattern portion of every pattern-action statement; the associated action is performed for each matched pattern. Any filename of the form var=value is treated as an assignment, not a filename, and is executed at the time it would have been opened if it were a filename. Variables assigned in this manner are not avail- able inside a BEGIN rule, and are assigned after previously specified files have been read. An input line is normally made up of fields separated by white spaces. (This default can be changed by using the FS SunOS 5.10 Last change: 22 Jun 2005 1 User Commands awk(1) built-in variable or the -Fc option.) The default is to ignore leading blanks and to separate fields by blanks and/or tab characters. However, if FS is assigned a value that does not include any of the white spaces, then leading blanks are not ignored. The fields are denoted $1, $2, ...; $0 refers to the entire line. Pattern-action Statements A pattern-action statement has the form: pattern { action } Either pattern or action can be omitted. If there is no action, the matching line is printed. If there is no pat- tern, the action is performed on every input line. Pattern- action statements are separated by newlines or semicolons. Patterns are arbitrary Boolean combinations ( !, ||, &&, and parentheses) of relational expressions and regular expres- sions. A relational expression is one of the following: expression relop expression expression matchop regular_expression where a relop is any of the six relational operators in C, and a matchop is either ~ (contains) or !~ (does not con- tain). An expression is an arithmetic expression, a rela- tional expression, the special expression var in array or a Boolean combination of these. Regular expressions are as in egrep(1). In patterns they must be surrounded by slashes. Isolated regular expressions in a pattern apply to the entire line. Regular expressions can also occur in relational expressions. A pattern can con- sist of two patterns separated by a comma; in this case, the action is performed for all lines between the occurrence of the first pattern to the occurrence of the second pattern. The special patterns BEGIN and END can be used to capture control before the first input line has been read and after the last input line has been read respectively. These SunOS 5.10 Last change: 22 Jun 2005 2 User Commands awk(1) keywords do not combine with any other patterns. Built-in Variables Built-in variables include: FILENAME name of the current input file FS input field separator regular expression (default blank and tab) NF number of fields in the current record NR ordinal number of the current record OFMT output format for numbers (default %.6g) OFS output field separator (default blank) ORS output record separator (default new-line) RS input record separator (default new-line) An action is a sequence of statements. A statement can be one of the following: if ( expression ) statement [ else statement ] while ( expression ) statement do statement while ( expression ) for ( expression ; expression ; expression ) statement for ( var in array ) statement break continue { [ statement ] ... } expression # commonly variable = expression print [ expression-list ] [ >expression ] SunOS 5.10 Last change: 22 Jun 2005 3 User Commands awk(1) printf format [ ,expression-list ] [ >expression ] next # skip remaining patterns on this input line exit [expr] # skip the rest of the input; exit status is expr Statements are terminated by semicolons, newlines, or right braces. An empty expression-list stands for the whole input line. Expressions take on string or numeric values as appropriate, and are built using the operators +, -, *, /, %, ^ and concatenation (indicated by a blank). The operators ++, --, +=, -=, *=, /=, %=, ^=, >, >=, <, <=, ==, !=, and ?: are also available in expressions. Variables can be scalars, array elements (denoted x[i]), or fields. Variables are ini- tialized to the null string or zero. Array subscripts can be any string, not necessarily numeric; this allows for a form of associative memory. String constants are quoted (""), with the usual C escapes recognized within. The print statement prints its arguments on the standard output, or on a file if >expression is present, or on a pipe if '|cmd' is present. The output resulted from the print statement is terminated by the output record separator with each argument separated by the current output field separa- tor. The printf statement formats its expression list according to the format (see printf(3C)). Built-in Functions The arithmetic functions are as follows: cos(x) Return cosine of x, where x is in radians. (In /usr/xpg4/bin/awk only. See nawk(1).) sin(x) Return sine of x, where x is in radians. (In /usr/xpg4/bin/awk only. See nawk(1).) exp(x) Return the exponential function of x. log(x) Return the natural logarithm of x. sqrt(x) Return the square root of x. SunOS 5.10 Last change: 22 Jun 2005 4 User Commands awk(1) int(x) Truncate its argument to an integer. It is truncated toward 0 when x > 0. The string functions are as follows: index(s, t) Return the position in string s where string t first occurs, or 0 if it does not occur at all. int(s) truncates s to an integer value. If s is not specified, $0 is used. length(s) Return the length of its argument taken as a string, or of the whole line if there is no argument. split(s, a, fs) Split the string s into array elements a[1], a[2], ... a[n], and returns n. The separation is done with the regular expression fs or with the field separator FS if fs is not given. sprintf(fmt, expr, expr,...) Format the expressions according to the printf(3C) for- mat given by fmt and returns the resulting string. substr(s, m, n) returns the n-character substring of s that begins at position m. SunOS 5.10 Last change: 22 Jun 2005 5 User Commands awk(1) The input/output function is as follows: getline Set $0 to the next input record from the current input file. getline returns 1 for successful input, 0 for end of file, and -1 for an error. Large File Behavior See largefile(5) for the description of the behavior of awk when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). EXAMPLES Example 1: Printing Lines Longer Than 72 Characters The following example is an awk script that can be executed by an awk -f examplescript style command. It prints lines longer than seventy two characters: length > 72 Example 2: Printing Fields in Opposite Order The following example is an awk script that can be executed by an awk -f examplescript style command. It prints the first two fields in opposite order: { print $2, $1 } Example 3: Printing Fields in Opposite Order with the Input Fields Separated The following example is an awk script that can be executed by an awk -f examplescript style command. It prints the first two input fields in opposite order, separated by a comma, blanks or tabs: BEGIN { FS = ",[ \t]*|[ \t]+" } { print $2, $1 } Example 4: Adding Up the First Column, Printing the Sum and Average The following example is an awk script that can be executed by an awk -f examplescript style command. It adds up the first column, and prints the sum and average: { s += $1 } END { print "sum is", s, " average is", s/NR } SunOS 5.10 Last change: 22 Jun 2005 6 User Commands awk(1) Example 5: Printing Fields in Reverse Order The following example is an awk script that can be executed by an awk -f examplescript style command. It prints fields in reverse order: { for (i = NF; i > 0; --i) print $i } Example 6: Printing All lines Between start/stop Pairs The following example is an awk script that can be executed by an awk -f examplescript style command. It prints all lines between start/stop pairs. /start/, /stop/ Example 7: Printing All Lines Whose First Field is Different from the Previous One The following example is an awk script that can be executed by an awk -f examplescript style command. It prints all lines whose first field is different from the previous one. $1 != prev { print; prev = $1 } Example 8: Printing a File and Filling in Page numbers The following example is an awk script that can be executed by an awk -f examplescript style command. It prints a file and fills in page numbers starting at 5: /Page/ { $2 = n++; } { print } Example 9: Printing a File and Numbering Its Pages Assuming this program is in a file named prog, the following example prints the file input numbering its pages starting at 5: example% awk -f prog n=5 input ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of awk: LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, NLSPATH, and PATH. LC_NUMERIC Determine the radix character used when interpreting numeric input, performing conversions between numeric and string values and formatting numeric output. Regardless of locale, the period character SunOS 5.10 Last change: 22 Jun 2005 7 User Commands awk(1) (the decimal-point character of the POSIX locale) is the decimal-point character recognized in processing awk programs (including assignments in command-line argu- ments). ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: /usr/bin/awk ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWesu | |_____________________________|_____________________________| | CSI | Not Enabled | |_____________________________|_____________________________| /usr/xpg4/bin/awk ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWxcu4 | |_____________________________|_____________________________| | CSI | Enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| SEE ALSO egrep(1), grep(1), nawk(1), sed(1), printf(3C), attri- butes(5), environ(5), largefile(5), standards(5) NOTES Input white space is not preserved on output if fields are involved. There are no explicit conversions between numbers and strings. To force an expression to be treated as a number, add 0 to it. To force an expression to be treated as a string, concatenate the null string ("") to it. SunOS 5.10 Last change: 22 Jun 2005 8
Friday, 1 January 2010
awk man page
auto_ef man page
User Commands auto_ef(1) NAME auto_ef - auto encoding finder SYNOPSIS /usr/bin/auto_ef [-e encoding_list] [-a] [-l level] [file ...] /usr/bin/auto_ef -h DESCRIPTION The auto_ef utility identifies the encoding of a given file. The utility judges the encoding by using the iconv code conversion, determining whether a certain code conversion was successful with the file, and also by performing fre- quency analyses on the character sequences that appear in the file. The auto_ef utility might produce unexpected output if the string is binary, a character table, a localized digit list, or a chronogram, or if the string or file is very small in size (for example, less than one 100 bytes). ASCII JIS ISO-2022-JP eucJP Japanese EUC PCK Japanese PC Kanji, CP932, Shift JIS UTF-8 Korean EUC ko_KR.euc ko_KR.cp949 Unified Hangul ISO-2022-KR ISO-2022 Korean zh_CN.iso2022-CN ISO-2022 CN/CN-EXT SunOS 5.10 Last change: 26 Sep 2004 1 User Commands auto_ef(1) zh_CN.euc Simplified Chinese EUC, GB2312 GB18030 Simplified Chinese GB18030/GBK zh_TW-big5 BIG5 zh_TW-euc Traditional Chinese EUC zh_TW.hkscs Hong Kong BIG5 iso-8859-1 West European, and similar iso-8859-2 East European, and similar iso-8859-5 Cyrillic, and similar iso-8859-6 Arabic iso-8859-7 Greek iso-8859-8 Hebrew CP1250 windows-1250, corresponding to ISO- 8859-2 CP1251 windows-1251, corresponding to ISO- 8859-5 SunOS 5.10 Last change: 26 Sep 2004 2 User Commands auto_ef(1) CP1252 windows-1252, corresponding to ISO- 8859-1 CP1253 windows-1253, corresponding to ISO- 8859-7 CP1255 windows-1255, corresponding to ISO- 8859-8 koi8-r corresponding to iso-8859-5 By default, auto_ef returns a single, most likely encoding for text in a specified file. To get all possible encodings for the file, use the -a option. Also by default, auto_ef uses the fastest process to examine the file. For more accurate results, use the -l option. To examine data with a limited set of encodings, use the -e option. OPTIONS The following options are supported: -a Shows all possible encodings in order of possibility, with scores in the range between 0.0 and 1.0. A higher score means a higher possi- bility. For example, example% auto_ef -a test_file eucJP 0.89 zh_CN.euc 0.04 ko_KR.euc 0.01 Without this option, only one encod- ing with the highest score is shown. -e encoding_list Examines data only with specified encodings. For example, when encoding_list is specified as SunOS 5.10 Last change: 26 Sep 2004 3 User Commands auto_ef(1) "ko_KR.euc:ko_KR.cp949", auto_ef examines text only with CP949 and ko_KR.euc. Without this option, auto_ef examines text with all encodings. Multiple encodings can be specified by separating the encod- ings using a colon (:). -h Shows the usage message. -l level Specifies the level of judgment. The value of level can be 0, 1, 2, or 3. Level 3 produces the best result but can be slow. Level 0 is fastest but results can be less accurate than in higher levels. The default is level 0. OPERANDS The following operands are supported: file File name to examine. EXAMPLES Example 1: Examining encoding of a file example% auto_ef file_name Example 2: Examining encoding of a file at level 2. example% auto_ef -l 2 file_name Example 3: Examining encoding of a file with only eucJP or ko_KR.euc example% auto_ef -e "eucJP:ko_KR.euc" file_name EXIT STATUS The following exit values are returned: 0 Successful completion SunOS 5.10 Last change: 26 Sep 2004 4 User Commands auto_ef(1) 1 An error occurred. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWautoef | |_____________________________|_____________________________| | Interface Stability | See below. | |_____________________________|_____________________________| Interface Stability of output format, when option -a is specified, is Evolving. Other interfaces are Stable. SEE ALSO auto_ef(3EXT), libauto_ef(3LIB), attributes(5) International Language Environments Guide SunOS 5.10 Last change: 26 Sep 2004 5
auths man page
User Commands auths(1) NAME auths - print authorizations granted to a user SYNOPSIS auths [ user ...] DESCRIPTION The auths command prints on standard output the authoriza- tions that you or the optionally-specified user or role have been granted. Authorizations are rights that are checked by certain privileged programs to determine whether a user may execute restricted functionality. Each user may have zero or more authorizations. Authoriza- tions are represented by fully-qualified names, which iden- tify the organization that created the authorization and the functionality that it controls. Following the Java conven- tion, the hierarchical components of an authorization are separated by dots (.), starting with the reverse order Internet domain name of the creating organization, and end- ing with the specific function within a class of authoriza- tions. An asterisk (*) indicates all authorizations in a class. A user's authorizations are looked up in user_attr(4) and in the /etc/security/policy.conf file (see policy.conf(4)). Authorizations may be specified directly in user_attr(4) or indirectly through prof_attr(4). Authorizations may also be assigned to every user in the system directly as default authorizations or indirectly as default profiles in the /etc/security/policy.conf file. EXAMPLES Example 1: Sample output The auths output has the following form: example% auths tester01 tester02 tester01 : solaris.system.date,solaris.jobs.admin tester02 : solaris.system.* example% Notice that there is no space after the comma separating the authorization names in tester01. EXIT STATUS The following exit values are returned: 0 Successful completion. SunOS 5.10 Last change: 25 Mar 2004 1 User Commands auths(1) 1 An error occurred. FILES /etc/user_attr /etc/security/auth_attr /etc/security/policy.conf /etc/security/prof_attr ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| SEE ALSO profiles(1), roles(1), getauthattr(3SECDB), auth_attr(4), policy.conf(4), prof_attr(4), user_attr(4), attributes(5) SunOS 5.10 Last change: 25 Mar 2004 2
audiorecord man page
User Commands audiorecord(1) NAME audiorecord - record an audio file SYNOPSIS audiorecord [-af] [-v vol] [-b bal] [-m monvol] [-p mic | line | internal-cd] [-c channels] [-s rate] [-e encoding] [-t time] [-i info] [-d dev] [-T au | aif[f] | wav] [file[.au|.aif[f]]|.wav] DESCRIPTION The audiorecord utility copies audio data from the audio device to a named audio file, or to the standard output if no filename is present. If no output file is specified and standard output is a tty, the volume, balance, monitor volume, port, and audio format settings specified on the command line will be applied and the program will exit. By default, monaural audio data is recorded at 8 kHz and encoded in -law format. If the audio device supports addi- tional configurations, the -c, -s, and -e options may be used to specify the data format. The output file is prefixed by an audio file header that identifies the format of the data encoded in the file. Recording begins immediately and continues until a SIGINT signal (for example, Control-c) is received. If the -t option is specified, audiorecord stops when the specified quantity of data has been recorded. If the audio device is unavailable, that is, if another pro- cess currently has read access, audiorecord prints an error message and exits immediately. OPTIONS The following options are supported: -\? Help: Prints a command line usage message. -a Append: Appends the data on the end of the named audio file. The audio device must support the audio data for- mat of the existing file. -b bal SunOS 5.10 Last change: 16 Jul 2003 1 User Commands audiorecord(1) Balance: The recording balance is set to the specified value before recording begins, and is reset to its pre- vious level when audiorecord exits. The bal argument is an integer value between -100 and 100, inclusive. A value of -100 indicates left balance, 0 middle, and 100 right. If this argument is not specified, the input bal- ance will remain at the level most recently set by any process. -c channels Channels: Specifies the number of audio channels (1 or 2). The value may be specified as an integer or as the string mono or stereo. The default value is mono. -d dev Device: The dev argument specifies an alternate audio device from which input should be taken. If the -d option is not specified, the AUDIODEV environment vari- able is consulted (see below). Otherwise, /dev/audio is used as the default audio device. -e encoding Encoding: Specifies the audio data encoding. This value may be one of ulaw, alaw, or linear. The default encod- ing is ulaw. -f Force: When the -a flag is specified, the sample rate of the audio device must match the sample rate at which the original file was recorded. If the -f flag is also specified, sample rate differences are ignored, with a warning message printed on the standard error. -i info Information: The `information' field of the output file header is set to the string specified by the info argu- ment. This option cannot be specified in conjunction SunOS 5.10 Last change: 16 Jul 2003 2 User Commands audiorecord(1) with the -a argument. -m monvol Monitor Volume: The input monitor volume is set to the specified value before recording begins, and is reset to its previous level when audiorecord exits. The monval argument is an integer value between 0 and 100, inclusive. A non-zero value allows a directly connected input source to be heard on the output speaker while recording is in-progress. If this argument is not speci- fied, the monitor volume will remain at the level most recently set by any process. -p mic | line | internal-cd Input Port: Selects the mic, line, or internal-cd input as the source of the audio output signal. If this argu- ment is not specified, the input port will remain unchanged. Please notice: Some systems will not support all possible input ports. If the named port does not exist, this option is ignored. -s rate Sample Rate: Specifies the sample rate, in samples per second. If a number is followed by the letter k, it is multiplied by 1000 (for example, 44.1k = 44100). The default sample rate is 8 kHz. -t time Time: The time argument specifies the maximum length of time to record. Time can be specified as a floating- point value, indicating the number of seconds, or in the form: hh:mm:ss.dd, where the hour and minute specifica- tions are optional. -T au | aif[f] | wav Specifies the audio file type to create. If the -a option is used, the file type must match the file to SunOS 5.10 Last change: 16 Jul 2003 3 User Commands audiorecord(1) which it is being appended. Regardless of the file suf- fix, the type will be set as specified in this option. If this option is not specified, the file suffix will determine the type. -v vol Volume: The recording gain is set to the specified value before recording begins, and is reset to its previous level when audiorecord exits. The vol argument is an integer value between 0 and 100, inclusive. If this argument is not specified, the input volume will remain at the level most recently set by any process. OPERANDS file[.au|.aif[f]]|.wav File Specification: The named audio file is rewritten, or appended. If no filename is present, and standard output is not a tty, or if the special filename "-" is specified, output is directed to the the standard out- put. If the -T option is not specified, the file suffix will determine the type of file. If the suffix is not recog- nized, the default is .au. If the -T option is speci- fied, that file type is used regardless of the file suf- fix. USAGE See largefile(5) for the description of the behavior of audiorecord when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). ENVIRONMENT VARIABLES AUDIODEV The full path name of the audio device to record from, if no -d argument is supplied. If the AUDIODEV variable is not set, /dev/audio is used. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: SunOS 5.10 Last change: 16 Jul 2003 4 User Commands audiorecord(1) ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Architecture | SPARC, x86 | |_____________________________|_____________________________| | Availability | SUNWauda | |_____________________________|_____________________________| | Interface Stability | Evolving | |_____________________________|_____________________________| SEE ALSO audioconvert(1), audioplay(1), mixerctl(1), attributes(5), largefile(5), usb_ac(7D), audio(7I), mixer(7I) SunOS 5.10 Last change: 16 Jul 2003 5
audioplay man page
User Commands audioplay(1) NAME audioplay - play audio files SYNOPSIS audioplay [-iV] [-v vol] [-b bal] [-p speaker | headphone | line] [-d dev] [file...] DESCRIPTION The audioplay utility copies the named audio files (or the standard input if no filenames are present) to the audio device. If no input file is specified and standard input is a tty, the port, volume, and balance settings specified on the command line will be applied and the program will exit. The input files must contain a valid audio file header. The encoding information in this header is matched against the capabilities of the audio device and, if the data formats are incompatible, an error message is printed and the file is skipped. Compressed ADPCM (G.721) monaural audio data is automatically uncompressed before playing. Minor deviations in sampling frequency (that is, less than 1%) are ordinarily ignored. This allows, for instance, data sampled at 8012 Hz to be played on an audio device that only supports 8000 Hz. If the -V option is present, such devia- tions are flagged with warning messages. OPTIONS The following options are supported: -i Immediate: If the audio device is unavailable (that is, another process currently has write access), audioplay ordinarily waits until it can obtain access to the dev- ice. When the -i option is present, audioplay prints an error message and exits immediately if the device is busy. -V Verbose: Prints messages on the standard error when waiting for access to the audio device or when sample rate deviations are detected. -v vol Volume: The output volume is set to the specified value SunOS 5.10 Last change: 16 Feb 2001 1 User Commands audioplay(1) before playing begins, and is reset to its previous level when audioplay exits. The vol argument is an integer value between 0 and 100, inclusive. If this argument is not specified, the output volume remains at the level most recently set by any process. -b bal Balance: The output balance is set to the specified value before playing begins, and is reset to its previ- ous level when audioplay exits. The bal argument is an integer value between -100 and 100, inclusive. A value of -100 indicates left balance, 0 middle, and 100 right. If this argument is not specified, the output balance remains at the level most recently set by any process. -p speaker | headphone | line Output Port: Selects the built-in speaker (the default), headphone jack, or line out as the destination of the audio output signal. If this argument is not specified, the output port will remain unchanged. Please note: Not all audio adapters support all of the output ports. If the named port does not exist, an appropriate substitute will be used. -d dev Device: The dev argument specifies an alternate audio device to which output should be directed. If the -d option is not specified, the AUDIODEV environment vari- able is consulted (see below). Otherwise, /dev/audio is used as the default audio device. -\? Help: Prints a command line usage message. OPERANDS file File Specification: Audio files named on the com- mand line are played sequentially. If no filenames are present, the standard input stream (if it is SunOS 5.10 Last change: 16 Feb 2001 2 User Commands audioplay(1) not a tty) is played (it, too, must contain an audio file header). The special filename `-' may be used to read the standard input stream instead of a file. If a relative path name is supplied, the AUDIOPATH environment variable is consulted (see below). USAGE See largefile(5) for the description of the behavior of audioplay when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). ENVIRONMENT VARIABLES AUDIODEV The full path name of the audio device to write to, if no -d argument is supplied. If the AUDIODEV variable is not set, /dev/audio is used. AUDIOPATH A colon-separated list of directories in which to search for audio files whose names are given by relative pathnames. The current directory (".") may be specified explicitly in the search path. If the AUDIOPATH vari- able is not set, only the current directory will be searched. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Architecture | SPARC, x86 | |_____________________________|_____________________________| | Availability | SUNWauda | |_____________________________|_____________________________| | Interface Stability | Evolving | |_____________________________|_____________________________| SEE ALSO audioconvert(1), audiorecord(1), mixerctl(1), attributes(5), largefile(5), usb_ac(7D), audio(7I), mixer(7I) SunOS 5.10 Last change: 16 Feb 2001 3 User Commands audioplay(1) BUGS audioplay currently supports a limited set of audio format conversions. If the audio file is not in a format supported by the audio device, it must first be converted. For exam- ple, to convert to voice format on the fly, use the command: example% audioconvert -f voice myfile | audioplay The format conversion will not always be able to keep up with the audio output. If this is the case, you should con- vert to a temporary file before playing the data. SunOS 5.10 Last change: 16 Feb 2001 4
audioconvert man page
User Commands audioconvert(1) NAME audioconvert - convert audio file formats SYNOPSIS audioconvert [-pF] [-f outfmt] [-o outfile] [ [-i infmt] [file...]] ... DESCRIPTION audioconvert converts audio data between a set of supported audio encodings and file formats. It can be used to compress and decompress audio data, to add audio file headers to raw audio data files, and to convert between standard data encodings, such as -law and linear PCM. If no filenames are present, audioconvert reads the data from the standard input stream and writes an audio file to the standard output. Otherwise, input files are processed in order, concatenated, and written to the output file. Input files are expected to contain audio file headers that identify the audio data format. If the audio data does not contain a recognizable header, the format must be specified with the -i option, using the rate, encoding, and channels keywords to identify the input data format. The output file format is derived by updating the format of the first input file with the format options in the -f specification. If -p is not specified, all subsequent input files are converted to this resulting format and con- catenated together. The output file will contain an audio file header, unless format=raw is specified in the output format options. Input files may be converted in place by using the -p option. When -p is in effect, the format of each input file is modified according to the -f option to determine the out- put format. The existing files are then overwritten with the converted data. The file(1) command decodes and prints the audio data format of Sun audio files. OPTIONS The following options are supported: -p In Place: The input files are individually converted to the format specified by the -f option and rewritten. If a target file is a symbolic link, the underlying file will be rewritten. The -o option may not be speci- fied with -p. SunOS 5.10 Last change: 16 Feb 2001 1 User Commands audioconvert(1) -F Force: This option forces audioconvert to ignore any file header for input files whose format is specified by the -i option. If -F is not specified, audioconvert ignores the -i option for input files that contain valid audio file headers. -f outfmt Output Format: This option is used to specify the file format and data encoding of the output file. Defaults for unspecified fields are derived from the input file for- mat. Valid keywords and values are listed in the next section. -o outfile Output File: All input files are con- catenated, converted to the output format, and written to the named output file. If -o and -p are not specified, the concatenated output is written to the standard output. The -p option may not be specified with -o. -i infmt Input Format: This option is used to specify the data encoding of raw input files. Ordi- narily, the input data format is derived from the audio file header. This option is required when converting audio data that is not preceded by a valid audio file header. If -i is specified for an input file that contains an audio file header, the input format string will be ignored, unless -F is present. The format specification syntax is the same as the -f output file format. Multiple input formats may be specified. An input format describes all input files fol- lowing that specification, until a new input format is specified. file File Specification: The named audio files are concatenated, converted to the output format, and written out. If no file name is present, or if the special file name `-' is specified, audio data is read from the stan- dard input. SunOS 5.10 Last change: 16 Feb 2001 2 User Commands audioconvert(1) -? Help: Prints a command line usage message. Format Specification The syntax for the input and output format specification is: keyword=value[,keyword=value ...] with no intervening whitespace. Unambiguous values may be used without the preceding keyword=. rate The audio sampling rate is specified in sam- ples per second. If a number is followed by the letter k, it is multiplied by 1000 (for example, 44.1k = 44100). Standard of the commonly used sample rates are: 8k, 16k, 32k, 44.1k, and 48k. channels The number of interleaved channels is speci- fied as an integer. The words mono and stereo may also be used to specify one and two channel data, respectively. encoding This option specifies the digital audio data representation. Encodings determine preci- sion implicitly (ulaw implies 8-bit preci- sion) or explicitly as part of the name (for example, linear16). Valid encoding values are: ulaw CCITT G.711 -law encoding. This is an 8-bit format pri- marily used for telephone quality speech. alaw CCITT G.711 A-law encoding. This is an 8-bit format pri- marily used for telephone quality speech in Europe. SunOS 5.10 Last change: 16 Feb 2001 3 User Commands audioconvert(1) linear8, Linear Pulse Code Modulation linear16, (PCM) encoding. The name linear32 identifies the number of bits of precision. linear16 is typically used for high quality audio data. pcm Same as linear16. g721 CCITT G.721 compression for- mat. This encoding uses Adaptive Delta Pulse Code Modulation (ADPCM) with 4- bit precision. It is pri- marily used for compressing -law voice data (achieving a 2:1 compression ratio). g723 CCITT G.723 compression for- mat. This encoding uses Adaptive Delta Pulse Code Modulation (ADPCM) with 3- bit precision. It is pri- marily used for compressing -law voice data (achieving an 8:3 compression ratio). The audio quality is similar to G.721, but may result in lower quality when used for non-speech data. The following encoding values are also accepted as shorthand to set the sample rate, channels, and encoding: voice Equivalent to encoding=ulaw,rate=8k,channels=mono. SunOS 5.10 Last change: 16 Feb 2001 4 User Commands audioconvert(1) cd Equivalent to encoding=linear16,rate=44.1k,channels=stereo. dat Equivalent to encoding=linear16,rate=48k,channels=stereo. format This option specifies the audio file format. Valid formats are: sun Sun compatible file format (the default). raw Use this format when reading or writing raw audio data (with no audio header), or in conjunction with an offset to import a foreign audio file format. offset (-i only) Specifies a byte offset to locate the start of the audio data. This option may be used to import audio data that contains an unrecognized file header. USAGE See largefile(5) for the description of the behavior of audioconvert when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). EXAMPLES Example 1: Recording and compressing voice data before stor- ing it Record voice data and compress it before storing it to a file: example% audiorecord | audioconvert -f g721 > mydata.au SunOS 5.10 Last change: 16 Feb 2001 5 User Commands audioconvert(1) Example 2: Concatenating two audio files Concatenate two Sun format audio files, regardless of their data format, and output an 8-bit ulaw, 16 kHz, mono file: example% audioconvert -f ulaw,rate=16k,mono -o outfile.au infile1 infile2 Example 3: Converting a directory to Sun format Convert a directory containing raw voice data files, in place, to Sun format (adds a file header to each file): example% audioconvert -p -i voice -f sun *.au ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Architecture | SPARC, x86 | |_____________________________|_____________________________| | Availability | SUNWauda | |_____________________________|_____________________________| | Interface Stability | Evolving | |_____________________________|_____________________________| SEE ALSO audioplay(1), audiorecord(1), file(1), attributes(5), large- file(5) NOTES The algorithm used for converting multi-channel data to mono is implemented by simply summing the channels together. If the input data is perfectly in phase (as would be the case if a mono file is converted to stereo and back to mono), the resulting data may contain some distortion. SunOS 5.10 Last change: 16 Feb 2001 6
atrm man page
User Commands atrm(1) NAME atrm - remove jobs spooled by at or batch SYNOPSIS atrm [-afi] [ [ job #] [user...]] DESCRIPTION The atrm utility removes delayed-execution jobs that were created with the at(1) command, but have not yet executed. The list of these jobs and associated job numbers can be displayed by using atq(1). atrm removes each job-number you specify, and/or all jobs belonging to the user you specify, provided that you own the indicated jobs. You can only remove jobs belonging to other users if you have solaris.jobs.admin privileges. OPTIONS The following options are supported: -a All. Removes all unexecuted jobs that were created by the current user. If invoked by the privileged user, the entire queue will be flushed. -f Force. All information regarding the removal of the specified jobs is suppressed. -i Interactive. atrm asks if a job should be removed. If you respond with a y, the job will be removed. FILES /var/spool/cron/atjobs spool area for at jobs ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: SunOS 5.10 Last change: 13 Aug 1999 1 User Commands atrm(1) ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| SEE ALSO at(1), atq(1), auths(1), cron(1M), auth_attr(4), attri- butes(5) SunOS 5.10 Last change: 13 Aug 1999 2
atq man page
User Commands atq(1) NAME atq - display the jobs queued to run at specified times SYNOPSIS atq [-c] [-n] [username...] DESCRIPTION The atq utility displays the at jobs queued up for the current user. at(1) is a utility that allows users to exe- cute commands at a later date. If invoked by a user with the solaris.jobs.admin authorization, atq will display all jobs in the queue. If no options are given, the jobs are displayed in chrono- logical order of execution. When an authorized user invokes atq without specifying user- name, the entire queue is displayed; when a username is specified, only those jobs belonging to the named user are displayed. OPTIONS The following options are supported: -c Displays the queued jobs in the order they were created (that is, the time that the at command was given). -n Displays only the total number of jobs currently in the queue. FILES /var/spool/cron/atjobs spool area for at jobs. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| SunOS 5.10 Last change: 13 Aug 1999 1 User Commands atq(1) SEE ALSO at(1), atrm(1), auths(1), cron(1M), auth_attr(4), attri- butes(5) SunOS 5.10 Last change: 13 Aug 1999 2
at man page
User Commands at(1) NAME at, batch - execute commands at a later time SYNOPSIS /usr/bin/at [-c | -k | -s] [-m] [-f file] [-p project] [- q queuename] -t time /usr/bin/at [-c | -k | -s] [-m] [-f file] [-p project] [- q queuename] timespec... /usr/bin/at -l [-p project] [-q queuename] [ at_job_id. ..] /usr/bin/at -r at_job_id. .. /usr/bin/batch [-p project] /usr/xpg4/bin/at [-c | -k | -s] [-m] [-f file] [-p project] [-q queuename] -t time /usr/xpg4/bin/at [-c | -k | -s] [-m] [-f file] [-p project] [-q queuename] timespec... /usr/xpg4/bin/at -l [-p project] [-q queuename] [ at_job_id. ..] /usr/xpg4/bin/at -r at_job_id. .. /usr/xpg4/bin/batch [-p project] DESCRIPTION at The at utility reads commands from standard input and groups them together as an at-job, to be executed at a later time. The at-job is executed in a separate invocation of the shell, running in a separate process group with no control- ling terminal, except that the environment variables, current working directory, file creation mask (see umask(1)), and system resource limits (for sh and ksh only, see ulimit(1)) in effect when the at utility is executed is retained and used when the at-job is executed. When the at-job is submitted, the at_job_id and scheduled time are written to standard error. The at_job_id is an identifier that is a string consisting solely of alphanumeric characters and the period character. The at_job_id is assigned by the system when the job is scheduled such that it uniquely identifies a particular job. User notification and the processing of the job's standard output and standard error are described under the -m option. SunOS 5.10 Last change: 13 Apr 2005 1 User Commands at(1) Users are permitted to use at and batch (see below) if their name appears in the file /usr/lib/cron/at.allow. If that file does not exist, the file /usr/lib/cron/at.deny is checked to determine if the user should be denied access to at. If neither file exists, only a user with the solaris.jobs.user authorization is allowed to submit a job. If only at.deny exists and is empty, global usage is permit- ted. The at.allow and at.deny files consist of one user name per line. cron and at jobs are not be executed if the user's account is locked. Only accounts which are not locked as defined in shadow(4) will have their job or process executed. batch The batch utility reads commands to be executed at a later time. Commands of the forms: /usr/bin/batch [-p project] /usr/xpg4/bin/batch [-p project] are respectively equivalent to: /usr/bin/at -q b [-p project] now /usr/xpg4/bin/at -q b -m [-p project] now where queue b is a special at queue, specifically for batch jobs. Batch jobs are submitted to the batch queue for immediate execution. Execution of submitted jobs can be delayed by limits on the number of jobs allowed to run con- currently. See queuedefs(4). OPTIONS If the -c, -k, or -s options are not specified, the SHELL environment variable by default determines which shell to use. For /usr/xpg4/bin/at and /usr/xpg4/bin/batch, if SHELL is unset or NULL, /usr/xpg4/bin/sh is used. For usr/bin/at and /usr/bin/batch, if SHELL is unset or NULL, /bin/sh is used. The following options are supported: -c C shell. csh(1) is used to execute the at- job. SunOS 5.10 Last change: 13 Apr 2005 2 User Commands at(1) -k Korn shell. ksh(1) is used to execute the at-job. -s Bourne shell. sh(1) is used to execute the at-job. -f file Specifies the path of a file to be used as the source of the at-job, instead of stan- dard input. -l (The letter ell.) Reports all jobs scheduled for the invoking user if no at_job_id operands are specified. If at_job_ids are specified, reports only information for these jobs. -m Sends mail to the invoking user after the at-job has run, announcing its completion. Standard output and standard error produced by the at-job are mailed to the user as well, unless redirected elsewhere. Mail is sent even if the job produces no output. If -m is not used, the job's standard output and standard error is provided to the user by means of mail, unless they are redirected elsewhere; if there is no such output to provide, the user is not notified of the job's completion. -p project Specifies under which project the at or batch job is run. When used with the -l option, limits the search to that particular project. Values for project is interpreted first as a project name, and then as a pos- sible project ID, if entirely numeric. By default, the user's current project is used. -q queuename Specifies in which queue to schedule a job for submission. When used with the -l SunOS 5.10 Last change: 13 Apr 2005 3 User Commands at(1) option, limits the search to that particular queue. Values for queuename are limited to the lower case letters a through z. By default, at-jobs are scheduled in queue a. In contrast, queue b is reserved for batch jobs. Since queue c is reserved for cron jobs, it can not be used with the -q option. -r at_job_id Removes the jobs with the specified at_job_id operands that were previously scheduled by the at utility. -t time Submits the job to be run at the time speci- fied by the time option-argument, which must have the format as specified by the touch(1) utility. OPERANDS The following operands are supported: at_job_id The name reported by a previous invocation of the at utility at the time the job was scheduled. timespec Submit the job to be run at the date and time specified. All of the timespec operands are interpreted as if they were separated by space characters and concatenated. The date and time are interpreted as being in the timezone of the user (as determined by the TZ variable), unless a timezone name appears as part of time below. In the "C" locale, the following describes the three parts of the time specification string. All of the values from the LC_TIME categories in the "C" locale are recognized in a case-insensitive manner. time The time can be specified as one, two or four digits. One- and two-digit numbers are taken to be hours, SunOS 5.10 Last change: 13 Apr 2005 4 User Commands at(1) four-digit numbers to be hours and minutes. The time can alternatively be speci- fied as two numbers separated by a colon, mean- ing hour:minute. An AM/PM indication (one of the values from the am_pm key- words in the LC_TIME locale category) can follow the time; otherwise, a 24-hour clock time is understood. A timezone name of GMT, UCT, or ZULU (case insensitive) can follow to specify that the time is in Coordinated Universal Time. Other timezones can be specified using the TZ environment variable. The time field can also be one of the following tokens in the "C" locale: midnight Indicates the time 12:00 am (00:00). noon Indicates the time 12:00 pm. now Indicate the current day and time. Invoking at now submits an at- job for potentially immediate execution (that is, subject only to unspecified scheduling delays). date An optional date can be specified as either a month name (one of the values from the mon or abmon keywords in SunOS 5.10 Last change: 13 Apr 2005 5 User Commands at(1) the LC_TIME locale category) followed by a day number (and possibly year number preceded by a comma) or a day of the week (one of the values from the day or abday keywords in the LC_TIME locale category). Two spe- cial days are recognized in the "C" locale: today Indicates the current day. tomorrow Indicates the day following the current day. If no date is given, today is assumed if the given time is greater than the current time, and tomorrow is assumed if it is less. If the given month is less than the current month (and no year is given), next year is assumed. increment The optional increment is a number preceded by a plus sign (+) and suffixed by one of the following: minutes, hours, days, weeks, months, or years. (The singular forms are also accepted.) The keyword next is equivalent to an increment number of + 1. For example, the following are equivalent commands: at 2pm + 1 week at 2pm next week SunOS 5.10 Last change: 13 Apr 2005 6 User Commands at(1) USAGE The format of the at command line shown here is guaranteed only for the "C" locale. Other locales are not supported for midnight, noon, now, mon, abmon, day, abday, today, tomor- row, minutes, hours, days, weeks, months, years, and next. Since the commands run in a separate shell invocation, run- ning in a separate process group with no controlling termi- nal, open file descriptors, traps and priority inherited from the invoking environment are lost. EXAMPLES at Example 1: Typical Sequence at a Terminal This sequence can be used at a terminal: $ at -m 0730 tomorrow sort < file >outfile <EOT> Example 2: Redirecting Output This sequence, which demonstrates redirecting standard error to a pipe, is useful in a command procedure (the sequence of output redirection specifications is significant): $ at now + 1 hour <<! diff file1 file2 2>&1 >outfile | mailx mygroup Example 3: Self-rescheduling a Job To have a job reschedule itself, at can be invoked from within the at-job. For example, this "daily-processing" script named my.daily runs every day (although crontab is a more appropriate vehicle for such work): # my.daily runs every day at now tomorrow < my.daily daily-processing Example 4: Various Time and Operand Presentations The spacing of the three portions of the "C" locale timespec is quite flexible as long as there are no ambiguities. Exam- ples of various times and operand presentations include: at 0815am Jan 24 at 8 :15amjan24 at now "+ 1day" at 5 pm FRIday at '17 SunOS 5.10 Last change: 13 Apr 2005 7 User Commands at(1) utc+ 30minutes' batch Example 5: Typical Sequence at a Terminal This sequence can be used at a terminal: $ batch sort <file >outfile <EOT> Example 6: Redirecting Output This sequence, which demonstrates redirecting standard error to a pipe, is useful in a command procedure (the sequence of output redirection specifications is significant): $ batch <<! diff file1 file2 2>&1 >outfile | mailx mygroup ! ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of at and batch: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, NLSPATH, and LC_TIME. DATEMSK If the environment variable DATEMSK is set, at uses its value as the full path name of a template file containing format strings. The strings consist of format specifiers and text characters that are used to provide a richer set of allowable date formats in dif- ferent languages by appropriate settings of the environment variable LANG or LC_TIME. The list of allowable format specifiers is located in the getdate(3C) manual page. The formats described in the OPERANDS section for the time and date arguments, the special names noon, midnight, now, next, today, tomorrow, and the increment argument are not recognized when DATEMSK is set. SHELL Determine a name of a command interpreter to be used to invoke the at-job. If the vari- able is unset or NULL, sh is used. If it is set to a value other than sh, the implemen- tation uses that shell; a warning diagnostic is printed telling which shell will be used. SunOS 5.10 Last change: 13 Apr 2005 8 User Commands at(1) TZ Determine the timezone. The job is submitted for execution at the time specified by timespec or -t time relative to the timezone specified by the TZ variable. If timespec specifies a timezone, it overrides TZ. If timespec does not specify a timezone and TZ is unset or NULL, an unspecified default timezone is used. EXIT STATUS The following exit values are returned: 0 The at utility successfully submitted, removed or listed a job or jobs. >0 An error occurred, and the job will not be scheduled. FILES /usr/lib/cron/at.allow names of users, one per line, who are authorized access to the at and batch utilities /usr/lib/cron/at.deny names of users, one per line, who are denied access to the at and batch utili- ties ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: /usr/bin/at SunOS 5.10 Last change: 13 Apr 2005 9 User Commands at(1) ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | CSI | Not enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| /usr/xpg4/bin/at ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWxcu4 | |_____________________________|_____________________________| | CSI | Not enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| /usr/bin/batch ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWesu | |_____________________________|_____________________________| | CSI | Enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| /usr/xpg4/bin/batch ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWxcu4 | |_____________________________|_____________________________| | CSI | Enabled | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| SEE ALSO auths(1), crontab(1), csh(1), date(1), ksh(1), sh(1), touch(1), ulimit(1), umask(1), cron(1M), getdate(3C), auth_attr(4), shadow(4), queuedefs(4), attributes(5), environ(5), standards(5) SunOS 5.10 Last change: 13 Apr 2005 10 User Commands at(1) NOTES Regardless of queue used, cron(1M) has a limit of 100 jobs in execution at any time. There can be delays in cron at job execution. In some cases, these delays can compound to the point that cron job pro- cessing appears to be hung. All jobs are executed eventu- ally. When the delays are excessive, the only workaround is to kill and restart cron. SunOS 5.10 Last change: 13 Apr 2005 11
asa man page
User Commands asa(1) NAME asa - convert FORTRAN carriage-control output to printable form SYNOPSIS asa [-f] [file...] DESCRIPTION The asa utility will write its input files to standard out- put, mapping carriage-control characters from the text files to line-printer control sequences. The first character of every line will be removed from the input, and the following actions will be performed. If the character removed is: SPACE The rest of the line will be output without change. 0 It is replaced by a newline control sequence fol- lowed by the rest of the input line. 1 It is replaced by a newpage control sequence fol- lowed by the rest of the input line. + It is replaced by a control sequence that causes printing to return to the first column of the pre- vious line, where the rest of the input line is printed. For any other character in the first column of an input line, asa skips the character and prints the rest of the line unchanged. If asa is called without providing a filename, the standard input is used. OPTIONS The following option is supported: -f Start each file on a new page. SunOS 5.10 Last change: 18 Apr 1995 1 User Commands asa(1) OPERANDS The following operand is supported: file A pathname of a text file used for input. If no file operands are specified, or `-' is specified, then the standard input will be used. EXAMPLES The command a.out | asa | lp converts output from a.out to conform with conventional printers and directs it through a pipe to the printer. The command asa output shows the contents of file output on a terminal as it would appear on a printer. The following program is used in the next two examples: write(*,'(" Blank")') write(*,'("0Zero ")') write(*,'("+ Plus ")') write(*,'("1One ")') end Both of the following examples produce two pages of output: Page 1: Blank ZeroPlus Page 2: One Example 1: Using actual files a.out > MyOutputFile asa < MyOutputFile | lp Example 2: Using only pipes SunOS 5.10 Last change: 18 Apr 1995 2 User Commands asa(1) a.out | asa | lp ENVIRONMENT VARIABLES See environ(5) for descriptions of the following environment variables that affect the execution of asa: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. EXIT STATUS The following exit values are returned: 0 All input files were output successfully. >0 An error occurred. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| | Interface Stability | Standard | |_____________________________|_____________________________| SEE ALSO lp(1), attributes(5), environ(5), standards(5) SunOS 5.10 Last change: 18 Apr 1995 3
as man page
User Commands as(1) NAME as - assembler SYNOPSIS SPARC as [-b] [-i] [ -K {pic,PIC}] [-L] [-m] [-n] [-o outfile] [-P] [-Dname] [-Dname=def] [-Ipath] [-Uname...] [-q] [-Qy | n] [-s] [ -S [a | b | c | l | A | B | C | L] ] [-T] [-V] [-xarch=v7 | -xarch=v8 | -xarch=v8a | -xarch=v8plus | -xarch=v8plusa | -xarch=v8plusb | -xarch=v9 | -xarch=v9a | -xarch=v9b ] [-xF] [-Y dirname] filename... x86 as [-b] [-i] [ -K PIC] [-L] [-m] [-n] [-o outfile] [-P] [- Dname] [-Dname=def] [-Ipath] [-Uname...] [-Qy | n] [-s] [ -S [a | b | c | l | A | B | C | L] ] [-T] [-V] [ -xarch=generic64 | -xarch=amd64] [-Y dirname] [-xmodel= [ SMALL | KERNEL ]] filename... DESCRIPTION The as command creates object files from assembly language source files. OPTIONS Common Options The following flags are common to both SPARC and x86. They may be specified in any order: -b Generates extra symbol table information. -i Ignore line number information from preprocessor. -K pic | PIC Generates position-independent code. -L Saves all symbols, including temporary labels that are normally discarded to save space, in the ELF symbol table. SunOS 5.10 Last change: 16 Sep 2005 1 User Commands as(1) -m Runs the m4(1) macro processor on the input to the assembler. -n Suppresses all the warnings while assembling. -o outfile Puts the output of the assembly in outfile. By default, the output file name is formed by removing the .s suf- fix, if there is one, from the input file name and appending a .o suffix. -P Runs cpp(1), the C preprocessor, on the files being assembled. The preprocessor is run separately on each input file, not on their concatenation. The preprocessor output is passed to the assembler. -Dname -Dname=def When the -P option is in effect, these options are passed to the cpp(1) preprocessor without interpretation by the as command; otherwise, they are ignored. -Ipath When the -P option is in effect, this option is passed to the cpp(1) preprocessor without interpretation by the as command; otherwise, it is ignored. -Uname When the -P option is in effect, this option is passed SunOS 5.10 Last change: 16 Sep 2005 2 User Commands as(1) to the cpp(1) preprocessor without interpretation by the as command; otherwise, it is ignored. -Qy | n If y is specified, this option produces the "assembler version" information in the comment section of the out- put object file. If n is specified, the information is suppressed. -s Places all stabs in the .stabs section. By default, stabs are placed in stabs.excl sections, which are stripped out by the static linker, ld(1), during final execution. When the -s option is used, stabs remain in the final executable because .stab sections are not stripped by the static linker. -S[a|b|c|l|A|B|C|L] Produces a disassembly of the emitted code to the stan- dard output. Adding each of the following characters to the -S option produces: a disassembling with address b disassembling with ".bof" c disassembling with comments l disassembling with line numbers Capital letters turn the switch off for the correspond- ing option. SunOS 5.10 Last change: 16 Sep 2005 3 User Commands as(1) -T This is a migration option for 4.x assembly files to be assembled on 5.x systems. With this option, the symbol names in 4.x assembly files will be interpreted as 5.x symbol names. -V Writes the version number of the assembler being run on the standard error output. -xF Allows function reordering by the Performance Analyzer. If you compile with the -xF option, and then run the Performance Analyzer, you can generate a map file that shows an optimized order for the functions. The subse- quent link to build the executable file can be directed to use that map file by using the linker -M mapfile option. It places each function from the executable file into a separate section. -Y dirname Specify directory m4 and/or cm4def. Options for SPARC only -q Performs a quick assembly. When the -q option is used, many error checks are not performed. Note: This option disables many error checks. Use of this option to assem- ble handwritten assembly language is not recommended. -xarch=v7 This option instructs the assembler to accept instruc- tions defined in the SPARC version 7 (V7) architecture. The resulting object code is in ELF format. SunOS 5.10 Last change: 16 Sep 2005 4 User Commands as(1) -xarch=v8 This option instructs the assembler to accept instruc- tions defined in the SPARC-V8 architecture, less the quad-precision floating-point instructions. The result- ing object code is in ELF format. -xarch=v8a This option instructs the assembler to accept instruc- tions defined in the SPARC-V8 architecture, less the quad-precision floating-point instructions and less the fsmuld instruction. The resulting object code is in ELF format. This is the default choice of the -xarch=options. -xarch=v8plus This option instructs the assembler to accept instruc- tions defined in the SPARC-V9 architecture, less the quad-precision floating-point instructions. The result- ing object code is in ELF format. It will not execute on a Solaris V8 system (a machine with a V8 processor). It will execute on a Solaris V8+ system. This combination is a SPARC 64-bit processor and a 32-bit OS. -xarch=v8plusa This option instructs the assembler to accept instruc- tions defined in the SPARC-V9 architecture, less the quad-precision floating-point instructions, plus the instructions in the Visual Instruction Set (VIS). The resulting object code is in V8+ ELF format. It will not execute on a Solaris V8 system (a machine with a V8 pro- cessor). It will execute on a Solaris V8+ system -xarch=v8plusb This option enables the assembler to accept instructions defined in the SPARC-V9 architecture, plus the instruc- tions in the Visual Instruction Set (VIS), with UltraSPARC-III extensions. The resulting object code is in V8+ ELF32 format. It executes only on an UltraSPARC-III processor. SunOS 5.10 Last change: 16 Sep 2005 5 User Commands as(1) -xarch=v9 This option limits the instruction set to the SPARC-V9 architecture. The resulting .o object files are in 64- bit ELF format and can only be linked with other object files in the same format. The resulting executable can only be run on a 64-bit SPARC processor running 64-bit Solaris with the 64-bit kernel. -xarch=v9a This option limits the instruction set to the SPARC-V9 architecture, adding the Visual Instruction Set (VIS) and extensions specific to UltraSPARC processors. The resulting .o object files are in 64-bit ELF format and can only be linked with other object files in the same format. The resulting executable can only be run on a 64-bit SPARC processor running 64-bit Solaris with the 64-bit kernel. -xarch=v9b This option enables the assembler to accept instructions defined in the SPARC-V9 architecture, plus the Visual Instruction Set (VIS), with UltraSPARC-III extensions. The resulting .o object files are in ELF64 format and can only be linked with other V9 object files in the same format. The resulting executable can only be run on a 64-bit UltraSPARC-III pro cessor running a 64-bit Solaris operating environment with the 64-bit kernel. Options for x86 Only --xarch=generic64 Limits the instruction set to AMD64. The resulting object code is in 64-bit ELF format. --xarch=amd64 Limits the instruction set to AMD64. The resulting object code is in 64-bit ELF format. SunOS 5.10 Last change: 16 Sep 2005 6 User Commands as(1) -xmodel=[SMALL | KERNEL] For AMD64 only, generate R_X86_64_32S relocatable type for static data access under KERNEL. Otherwise, generate R_X86_64_32 under SMALL. SMALL is the default. OPERANDS The following operand is supported: filename Assembly language source file ENVIRONMENT VARIABLES TMPDIR The as command normally creates temporary files in the directory /tmp. Another direc- tory may be specified by setting the environment variable TMPDIR to the chosen directory. (If TMPDIR is not a valid direc- tory, then as will use /tmp). FILES By default, as creates its temporary files in /tmp. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWsprot | |_____________________________|_____________________________| SEE ALSO cc(1B), cpp(1),ld(1), m4(1), nm(1), strip(1), tmpnam(3C), a.out(4), attributes(5) dbx and analyzer manual pages available with Sun Studio documentation. NOTES If the -m option, which invokes the m4(1) macro processor, is used, keywords for m4 cannot be used as symbols (vari- ables, functions, labels) in the input file, since m4 cannot determine which keywords are assembler symbols and which keywords are real m4 macros. SunOS 5.10 Last change: 16 Sep 2005 7 User Commands as(1) Whenever possible, access the assembler through a compila- tion system interface program such as cc(1B). All undefined symbols are treated as global. SunOS 5.10 Last change: 16 Sep 2005 8
arch man page
User Commands arch(1) NAME arch - display the architecture of the current host SYNOPSIS arch [-k | archname] DESCRIPTION The arch utility displays the application architecture of the current host system. Due to extensive historical use of this command without any options, all SunOS 5.x SPARC based systems will return "sun4" as their application architec- ture. Use of this command is discouraged. See NOTES section below. Systems can be broadly classified by their architectures, which define what executables will run on which machines. A distinction can be made between kernel architecture and application architecture (or, commonly, just "architec- ture"). Machines that run different kernels due to underly- ing hardware differences may be able to run the same appli- cation programs. OPTIONS -k Displays the kernel architecture, such as sun4u. This defines which specific SunOS kernel will run on the machine, and has implications only for pro- grams that depend on the kernel explicitly (for example, ps(1)). OPERANDS The following operand is supported: archname Use archname to determine whether the appli- cation binaries for this application archi- tecture can run on the current host system. The archname must be a valid application architecture, such as sun4, i86pc, and so forth. If application binaries for archname can run on the current host system, TRUE (0) is returned. Otherwise, FALSE (1) is returned. EXIT STATUS The following exit values are returned: 0 Successful completion. SunOS 5.10 Last change: 21 Oct 2002 1 User Commands arch(1) >0 An error occurred. ATTRIBUTES See attributes(5) for descriptions of the following attri- butes: ____________________________________________________________ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |_____________________________|_____________________________| | Availability | SUNWcsu | |_____________________________|_____________________________| SEE ALSO mach(1), ps(1), uname(1), attributes(5) NOTES This command is provided for compatibility with previous releases and its use is discouraged. Instead, the uname com- mand is recommended. See uname(1) for usage information. SunOS 5.10 Last change: 21 Oct 2002 2
Subscribe to:
Posts (Atom)