Sponsored Content
Full Discussion: append the position 28:33
Top Forums Shell Programming and Scripting append the position 28:33 Post 302369071 by Scrutinizer on Friday 6th of November 2009 11:00:25 AM
Old 11-06-2009
Code:
sed 's/OLF-AA/OLF-1E/;s/ODL-SP/ODL-2S/;s/ODL-CH/ODL-3C/' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Append line based on fixed position

Hi all; I'm having headache on append one line to another based on the fix position.Hope u guys can help. All i need to do is append the line that start with '3' to a line which start with '1' and the position for line 3 that i need to append is 22. The original file look like this: ... (2 Replies)
Discussion started by: ashikin_8119
2 Replies

2. Shell Programming and Scripting

how to find a position and print some string in the next and same position

I need a script for... how to find a position of column data and print some string in the next line and same position position should find based on *HEADER8* in text for ex: ord123 abs 123 987HEADER89 test234 ord124 abc 124 987HEADER88 test235 ... (1 Reply)
Discussion started by: naveenkcl
1 Replies

3. UNIX for Dummies Questions & Answers

find if a position is between a given start and end position

Hi, I am a newbie in unix programming so maybe this is a simple question. I would like to know how can I make a script that outputs only the values that are not between any given start and end positions Example file1: 2 30 40 80 82 100 file2: ID1 1 ID2 35 ID3 80 ID4 81 ID6... (9 Replies)
Discussion started by: fadista
9 Replies

4. Shell Programming and Scripting

append existing file with zeroes bsed on position

Hi i am trying to append value with 0 to an existing file in the position 50-56 & 58-64 only where empty space is there Rule: 1 row already has some value and i do not want to change anything for this row. 2nd record below you see the position 50-64 is empty, i want to replace with 0000000... (3 Replies)
Discussion started by: kshuser
3 Replies

5. Shell Programming and Scripting

append each line on fixed position 31 to 33

I have a .DAT file like below. 26666666660001343 000001004OLF 029100020090820 27777777770000060 000001004ODL-CH001000020090820 28888888880000780 000001013OLF 006500020090820 ....... ........ and so on..... I want to append each line in a file in .KSH script with XXX with position... (5 Replies)
Discussion started by: kshuser
5 Replies

6. Shell Programming and Scripting

Moving first position in a file to the last position

hi, I have a file which consists of some records: 2010_06_4010093_001_001|10|ABCDEFGH|9|4010093||0040400||31.12.2009|S|O|X||||20100602093851-31.12.2009|XXBBFC|EFG||||00001| 2010_06_4010162_001_001|11|ABCDEFGH|9|4010162||0040400||31.12.2009|S|O|X||||20100602093851-31.12.2009|XXBBFC|EFG||||00002|... (11 Replies)
Discussion started by: pparthiv
11 Replies

7. Shell Programming and Scripting

Remove text from n position to n position sed/awk

I want to remove text from nth position to nth position couple of times in same line my line is "hello is there anyone can help me with this question" I need like this ello is there anyone can help me with question 'h' is removed and 'this' removed from the line. I want to do this... (5 Replies)
Discussion started by: elamurugu
5 Replies

8. Shell Programming and Scripting

Need command or script to print all lines from 2nd position to last but one position

hi guys, i want command or script to display the content of file from 2nd position to last but one position of a file abcdefghdasdasdsd 123,345,678,345,323 434,656,656,656,656 678,878,878,989,545 4565656667,65656 i want to display the same above file without first and... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies

9. Shell Programming and Scripting

Search for a string at a particular position and replace with blank based on position

Hi, I have a file with multiple lines(fixed width dat file). I want to search for '02' in the positions 45-46 and if available, in that lines, I need to replace value in position 359 with blank. As I am new to unix, I am not able to figure out how to do this. Can you please help me to achieve... (9 Replies)
Discussion started by: Pradhikshan
9 Replies

10. Shell Programming and Scripting

Inserting value at a particular position without changing the position of other characters

Hi All, I wanted a sed/awk command to add a value/character on a particular position without disturbing the position of other characters. I have file a.txt OL 10031 Day Black Midi Good Value P01 P07 OL 10031 Day Black Short Good Value P01 P07 I want to get the output as... (2 Replies)
Discussion started by: rahulsk
2 Replies
stty(1) 						      General Commands Manual							   stty(1)

NAME
stty - Sets terminal characteristics SYNOPSIS
stty [-a | -g] [-f special-device] stty [-f special-device] [argument...] STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: stty: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Writes to standard output all the current settings for the terminal. [Tru64 UNIX] Allows you to specify an alternate terminal or teletype device. Normally, the stty command works on standard input. Writes to standard output the current settings in an unspecified form that can be used as arguments to another stty utility on the same system. DESCRIPTION
The stty utility sets or reports on terminal I/O characteristics for the device that is its standard input. The -dsusp switch works only when the terminal settings are set to the BSD clist options in the sysconfigtab file. The stty -status command is no longer supported. Without options or arguments specified, stty reports the settings of certain characteristics, usually those that differ from implementa- tion-defined defaults; otherwise, stty modifies the terminal state according to the specified arguments. Some combinations of arguments are mutually exclusive on some terminal types. Sections marked with (I18N) describe features that are available when: The Tru64 UNIX optional subsets for Asian country support are installed on your system. The Asian or Thai terminal interface has been enabled. Control Modes The following arguments are available to set the terminal characteristics: Enables (disables) parity generation and detection. Selects odd (even) parity. Selects character size, if possible. Sets terminal baud rate to the number given, if possible. If the baud rate is set to zero, modem control is no longer asserted. Sets terminal input baud rate to the number given, if possible. If zero is specified, the input baud rate is set to be the same as the output baud rate. Sets terminal output baud rate to the number given, if possible. If the output baud rate is set to zero, modem control is no longer asserted. Stops asserting modem control (does not stop asserting modem con- trol) on last close. Same as hupcl (-hupcl). Uses two (one) stop bits per character. Enables (disables) the receiver. Assumes a line without (with) modem control. [Tru64 UNIX] Enables (disables) hardware flow control using the Request to Send (RTS) and Clear to Send (CTS) signals. [Tru64 UNIX] Disables (enables) the printing of kernel-generated status information when the info control character is entered. Input Modes [Tru64 UNIX] Echoes control characters as ^X and <Delete> as ^?. Prints two backspaces following the End-of-File character. (Special characters are echoed as themselves.) Ignores (does not ignore) break on input. Signals (does not signal) INTR on break. Ignores (does not ignore) parity errors. Marks (does not mark) parity errors. Enables (disables) input parity checking. Strips (does not strip) input characters to seven bits. Maps (does not map) newline to carriage-return on input. Ignores (does not ignore) carriage-return on input. Maps (does not map) carriage-return to newline on input. [Tru64 UNIX] Does (does not) ring bell on terminal when input buffer is full. Maps (does not map) uppercase alphabetic characters to lowercase. Enables (disables) Start/Stop output control. Output from the system is stopped when the system receives Stop and started when the system receives Start. Allows any character (allows only <Ctrl-q>) to restart output. Requests that the system send (not send) Start/Stop characters when the input queue is nearly empty/full. Output Modes Post-processes output (does not post-process output; ignores all other output modes). Maps (does not map) lowercase alphabetic characters to uppercase on output. [Tru64 UNIX] Discards (keeps) End-of-Text on output. [Tru64 UNIX] Maps (does not map) newline characters to carriage-return/newline characters. Maps (does not map) carriage-return/newline characters to newline characters. Does not (does) output carriage-return characters at column 0 (zero). Causes (does not cause) newline to perform the carriage-return function on the terminal. Uses fill characters (uses timing) for delays. Uses Delete (uses Null) characters for fill characters. [Tru64 UNIX] Maintains (expands to spaces) any tab characters in the output. Selects style of delay for carriage-return characters. Selects style of delay for newline characters. Selects style of delay for horizontal tabs. Selects style of delay for backspaces. Selects style of delay for form feeds. Selects style of delay for vertical tabs. [Tru64 UNIX] Specifies the number of lines this display can hold. [Tru64 UNIX] Specifies the number of characters per display line. Local Modes [Tru64 UNIX] Uses (does not use) the altwerase mode, which defines a word as containing only alphanumeric characters and _ (underscore). Enables (disables) the checking of characters against the special control characters INTR, QUIT, and SUSP. Enables (disables) canonical input (Erase and Kill processing). [Tru64 UNIX] Echoes (does not echo) the Kill character by erasing the line in place like echoe. [Tru64 UNIX] Uses (does not use) carrier as a flow control flag rather than sending a HANGUP signal. [Tru64 UNIX] Prints (does not print) erased characters backwards within (backslash) and / (slash). Stops (allows) output from background jobs to the terminal. [Tru64 UNIX] Echoes (does not echo) uppercase characters on input, and displays uppercase characters on output with a preceding (backslash). Enables (disables) any implementation-defined special control-characters not currently controlled by icanon, isig, or ixon. Echoes back (does not echo back) every character typed. Causes the Erase character to (to not) visually erase the last character in the current line from the display, if possible. Echoes (does not echo) newline after the Kill character. Echoes (does not echo) newline, even if echo is disabled. Disables (enables) flush after INTR, QUIT, SUSP. Control Assignments Sets special-character to string. The special character is set to the first character in string and subsequent characters are ignored, with the following exceptions: The strings undef and ^- set the special character to {_POSIX_VDISABLE} if it is in effect for the device. The string ^? sets the special character to <Delete>. Any other string beginning with the character ^ sets the special character to the con- trol character corresponding to the second character of string (subsequent characters are ignored). For example, the string ^c sets the special character to ^C; the string ^zq sets the special character to ^Z. Note that you can set a special character to a control character in two ways: by entering the control character itself or by enter- ing ^ and another character. This allows you to enter a control characters that is already assigned to a special character without entering that special character; for example, you can enter ^C, even if it is already assigned to the intr special character, by entering ^ and then c. Recognized special-characters include dsusp, eof, eol, eol2, erase, discard, status, intr, kill, lnext, quit, reprint, start, stop, susp, and werase. Sets the current terminal characteristics to the saved settings produced by the -g option. Sets the value of min or time to number. MIN and TIME are used in Non-Canonical mode input processing (-icanon). Sets the line discipline to the speci- fied number. Combination Modes Enables parenb and cs7; disables parodd. Enables parenb, cs7, and parodd. Disables parenb, and sets cs8. Enables (disables) raw input and output (no ERASE, KILL, INTR, QUIT, EOT, or output processing). Enables (disables) icrnl and onlcr. The -nl mode also unsets inlcr, igncr ocrnl, and onlret. Sets (unsets) xcase, iuclc, and olcuc. (Used for terminals with uppercase characters only.) Resets all modes to some reasonable values. Asian Line Discipline Setup (I18N) Sets the current line discipline to Asian and sets up the processing environment for Asian codesets other than those for Japanese. The application code is set to the codeset defined in the current locale. The terminal code may also be set to the same codeset when not defined. Sets the current line discipline to Asian and sets up the processing environment for Japanese codesets. Terminal code is always be set to dec, but the application code depends on the current local setting. If a valid Japanese codeset is found in the current locale, the application code is set to that codeset. Otherwise, the application code is set to eucJP. Do not select the adec or jdec line discipline for a console that is using the KEBUG driver. Doing so may cause the console to hang. Modes for Terminal and Application Code (I18N) Sets the application code to codeset. Sets the terminal code to codeset. Sets both the terminal code and the application code to codeset. Enables (disables) codeset conversion between the internal code and the application and terminal codes. Codeset conversion must be enabled in order for Asian terminal features to work. Codeset conversion should be disabled only under certain circumstances that do not allow modification of data passing through the terminal lines. One such circumstance would be running an 8-bit binary file transfer protocol, such as kermit and sz (zmodem). Japanese Input Modes (I18N) Sets the input mode for 8-bit code or Hankaku Kana code from the terminal. The following keywords can be used for the mode argument: The 8-bit code from the terminal is treated as a part of the Kanji code when the terminal code is set to dec. The 8-bit code (when terminal code is dec) or the Hankaku Kana code from the terminal is converted to the 16-bit Hiragana code. The 8-bit code (when terminal code is dec) or the Hankaku Kana code from the terminal is converted to the 16-bit Katakana code. The 8-bit code (when terminal code is dec) or the Hankaku Kana code from the terminal is converted to the 8-bit Hankaku Kana code. Enables (disables) the Japanese input method. The Kana-Kanji conversion daemon, kkcd, is spawned (ikk) or killed (-ikk). The kkseq key map information is derived from the following (in priority order): The file specified by the JSYKKSEQ environment variable The ~/.jsykkseq file Dictionary names are derived from the following (in priority order): The files specified by the JSYTANGO, JSYKOJIN, and JSYLEARN environment variables The /usr/i18n/jsy/jsytango.dic, ~/jsykojin.dic, and ~/.jsylearn files. Sets the character or sequence of characters that enters Kana-Kanji conversion mode when using the STREAMS terminal driver. Sets the JIS Kanji shift-in escape sequence for the JIS terminal. Sets the JIS Kanji shift-out escape sequence for the JIS terminal. Sets the character attribute used to mark a clause that is the result of the Kana-Kanji conversion. The four possible values for mode are bold, underline, reverse, or none. The sequences that determine these values are taken from the terminfo database. The bold sequence is taken from "md" and "me", reverse is taken from "mr" and "me", and underline is taken from "us" and "ue". Sets the character attribute used to mark a Henkan region that is the result of the Kana-Kanji conversion. The four possible values for mode are bold, underline, reverse, or none. The sequences that determine these values are taken from the terminfo database. The old sequence is taken from "md" and "me", reverse is taken from "mr" and "me", and underline is taken from "us" and "ue". Sets the Kana-Kanji conversion key map file for the terminal. Displays the current Kana-Kanji conversion key map, a traversal tree with a maximum sequence length of 15 characters. Uses one (uses two) backspaces to erase one Kanji character on the terminal. Uses (does not use) a single 2-byte zenkaku space (two ASCII spaces) to blank out one Kanji character on the terminal. If terminal code is either jis7 or jis8, changes (does not change) the terminal state to shift out whenever a newline code is output. Enables (disables) the extended Kana-Kanji conversion mode. The char value sets or resets the character that toggles in and out of extended Kana-Kanji conversion mode. Modes for Software On-Demand Loading (I18N) Enables (disables) the Software On-Demand Loading (SoftODL) service. Sets the maximum size, in characters, of the ODL buffer. This size should be the same as the terminal's font cache size. The default size is 256. Sets the type of the ODL buffer replacement strategy. The type arguments can be either fifo (First-In-First-Out) or lru (Least-Recently-Used). Sets the path to the ODL database files. If this path is not specified, the default path is the one for the user's private database (if private databases are allowed on the system) or to the systemwide ODL database. Resets the ODL service and clears the internal ODL buffers. Displays the current ODL service attributes. Modes for the Software Phrase Input Method (I18N) Enables (disables) the Software Phrase Input Method (SIM) service. Specifies the key that toggles in and out of phrase input mode. Sets the current class name for locating the appropriate phrase in the phrase database. Sets the path of the phrase database. Sets the display mode of the SIM service. The two supported mode values are offspot (default) and onspot. In offspot mode, the input phrase name is dis- played at the 26th line of your terminal, if supported. In onspot mode, the phrase name is displayed at the current cursor position. With DECterm, xterm, or other terminal emulators that do not support the 26th display line, specify the onspot mode value. Displays the current SIM service attributes. Miscellaneous Asian Terminal Modes (I18N) Enables (disables) the history mechanism. The key value sets or resets the key used to toggle in and out of history mode. Note that com- mand lines that are fewer than three characters long are not recorded in the history list. Thai Terminal Modes (I18N) Sets the current line discipline to Thai. Sets the WTT Input Sequence Check (ISC) mode. Valid mode values are 0, 1, or 2, which stand for pass-through, basic check, or strict mode, respectively. Enables or disables input reordering. Enables (disables) the history mechanism. The key value sets or resets the key used to toggle in and out of history mode. Note that command lines that are fewer than three charac- ters long are not recorded in the history list. Compatibility Modes Resets Erase and Kill characters back to the system defaults. Same as echok. Same as ixon (-ixon). Same as ixoff (-ixoff). Same as ixany (-ixany). Sets all modes suitable for terminals developed by Digital Equipment Corporation (now Compaq Computer Corporation). (The control-character Erase is set to ^?). (I18N) For the Asian (atty) and Thai (ttty) terminal interfaces, dec also switches the line discipline back to the default TTYDISC line discipline. Same as echoe (-echoe). Same as echoctl (-echoctl). Sets (clears) echoe, echoke, and echoctl. Sends output characters with no (with) output processing. Expands (does not expand) tabs to spaces. Same as ofill (-ofill). Same as -a. Does not (does) send HANGUP signal if carrier drops. Does character fill and uses Null character. Does character fill and uses Delete character. Sets modes suitable for the Teletype Corporation Model 33 terminal. Sets modes suitable for the Teletype Corporation Model 37 terminal. Sets modes suitable for the Digital Equipment Corporation Model VT05 terminal. Sets modes suitable for the Gen- eral Electric TermiNet 300. Sets modes suitable for the Texas Instruments 700 series. Sets modes suitable for the Tektronix 4014 terminal. Prints only the line speed and a trailing semicolon (;). Prints only the terminal size. If no options are specified, an unspecified subset of the information displayed for the -a option is displayed. If the terminal input speed and output speed are the same, the speed information is displayed as follows: speed speed baud Otherwise, speeds are displayed as follows: ispeed ispeed baud; ospeed ospeed baud; Control-characters are displayed as follows: control-character = value In this display, value is either the character, some visual representation of the character if it is nonprinting, or the string undef if the character is disabled. EXIT STATUS
The stty utility exits with one of the following values: The terminal options were read or set successfully. An error occurred. ENVIRONMENT VARIABLES
The following environment variables affect the execution of stty: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. SEE ALSO
Commands: tty(1) Functions: ioctl(2) Routines: curses(3), tcgetattr(3), tcsetattr(3), ttyname(3) Files: termios(4), atty(7), tty(7), ttty(7) Standards: standards(5) Others: Chinese(5), i18n_intro(5), iconv_intro(5), Japanese(5), Korean(5), Thai(5) stty(1)
All times are GMT -4. The time now is 03:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy