Sponsored Content
Top Forums Shell Programming and Scripting oneliner:sing SED on a specific column Post 302214850 by mirusnet on Tuesday 15th of July 2008 04:45:24 AM
Old 07-15-2008
Code:
echo "mv /prod/system/system.db2 /prod/system/system.db2" | sed 's/\([a-z]*\) \([0-9a-z/.]*\) \/prod/\1 \2 \/devel/'
mv /prod/system/system.db2 /devel/system/system.db2

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Insert a text from a specific row into a specific column using SED or AWK

Hi, I am having trouble converting a text file. I have been working for this whole day now, still i couldn't make it. Here is how the text file looks: _______________________________________________________ DEVICE STATUS INFORMATION FOR LOCATION 1: OPER STATES: Disabled E:Enabled ... (5 Replies)
Discussion started by: Issemael
5 Replies

2. Shell Programming and Scripting

Paste value at specific column using sed

Hi I want to paste some value at specific column in a file using sed. say I want to add "Welcome to UNIX" from column 300 onwards in a file using sed. How to do it . ---------- Post updated at 11:18 AM ---------- Previous update was at 11:09 AM ---------- Adding more information : I... (14 Replies)
Discussion started by: dashing201
14 Replies

3. Shell Programming and Scripting

Can sed be used to insert data at specific column?

I'm trying to use sed to insert data at a specific column, let's say my data looks like this: 0553 1828 0552 1829 0550 1829 0549 1830 0548 1831 what I want is this: timein 0553 timeout 1828 timein 0552 timeout 1829 timein 0550 timeout 1829 timein 0549 timeout 1830 timein 0548... (5 Replies)
Discussion started by: mswartz
5 Replies

4. Shell Programming and Scripting

Assigning a specific format to a specific column in a text file using awk and printf

Hi, I have the following text file: 8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm 9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm 10 T1mapping_flip10 ok 128 108 30 1 665000-000010-000001.dcm 11 T1mapping_flip15 ok 128 108 30... (2 Replies)
Discussion started by: goodbenito
2 Replies

5. UNIX for Dummies Questions & Answers

deleteing duplicate lines sing uniq while ignoring a column

I have a data set that has 4 columns, I want to know if I can delete duplicate lines while ignoring one of the columns, for example 10 chr1 ASF 30 15 chr1 ASF 20 5 chr1 ASF 30 6 chr2 EBC 15 4 chr2 EBC 30 ... I want to know if I can delete duplicate lines while ignoring column 1, so the... (5 Replies)
Discussion started by: japaneseguitars
5 Replies

6. UNIX for Dummies Questions & Answers

Use sed to replace but only in a specific column of the text file

Hi, I would like to use sed to replace NA to x ('s/NA/x/g'), but only in the 5th column of the space delimited text file, nowhere else. How do I go about doing that? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies

7. UNIX for Dummies Questions & Answers

Excluding a specific column from sed replacement

Hi, I would like to replace all 0's to 1's throughout my text file. However I do not want column 3 altered. How do I go about doing that? Thanks! (2 Replies)
Discussion started by: evelibertine
2 Replies

8. Shell Programming and Scripting

awk or sed to find specific column from different files

Hi everybody, I have a folder with many files: Files with 8 columns: X 123 A B C D E F And files with 7 columns: X1234 A B C D E F I am trying to find a way to extract the 5th column when the files have eight columns, or the 4th column when the files have... (3 Replies)
Discussion started by: Tzole
3 Replies

9. Shell Programming and Scripting

Overwrite specific column in xml file with the specific column from adjacent line

I have an xml file dumped from rrd file, that I want to "patch" so the xml file doesn't contain any blank hole in the resulting graph of the rrd file. Here is the file. <!-- 2015-10-12 14:00:00 WIB / 1444633200 --> <row><v> 4.0419731265e+07 </v><v> 4.5045912770e+06... (2 Replies)
Discussion started by: rk4k
2 Replies

10. Shell Programming and Scripting

sed or awk to remove specific column to one range

I need to remove specific column to one range source file 3 1 000123456 2 2 000123569 3 3 000123564 12 000123156 15 000125648 128 000125648 Output required 3 000123456 2 000123569 3 000123564 12 000123156 15 000125648 128 000125648 (6 Replies)
Discussion started by: ranjancom2000
6 Replies
syncloop(1M)						  System Administration Commands					      syncloop(1M)

NAME
syncloop - synchronous serial loopback test program SYNOPSIS
/usr/sbin/syncloop [-cdlstv] device DESCRIPTION
The syncloop command performs several loopback tests that are useful in exercising the various components of a serial communications link. Before running a test, syncloop opens the designated port and configures it according to command line options and the specified test type. It announces the names of the devices being used to control the hardware channel, the channel number (ppa) corresponding to the device argument, and the parameters it has set for that channel. It then runs the loopback test in three phases. The first phase is to listen on the port for any activity. If no activity is seen for at least four seconds, syncloop proceeds to the next phase. Otherwise, the user is informed that the line is active and that the test cannot proceed, and the program exits. In the second phase, called the "first-packet" phase, syncloop attempts to send and receive one packet. The program will wait for up to four seconds for the returned packet. If no packets are seen after five attempts, the test fails with an excoriating message. If a packet is returned, the result is compared with the original. If the length and content do not match exactly, the test fails. The final phase, known as the "multiple-packet" phase, attempts to send many packets through the loop. Because the program has verified the integrity of the link in the first-packet phase, the test will not fail after a particular number of timeouts. If a packet is not seen after four seconds, a message is displayed. Otherwise, a count of the number of packets received is updated on the display once per second. If it becomes obvious that the test is not receiving packets during this phase, the user may wish to stop the program manually. The number and size of the packets sent during this phase is determined by default values, or by command line options. Each returned packet is com- pared with its original for length and content. If a mismatch is detected, the test fails. The test completes when the required number of packets have been sent, regardless of errors. After the multiple-packet phase has completed, the program displays a summary of the hardware event statistics for the channel that was tested. The display takes the following form: CRC errors Aborts Overruns Underruns In<-Drops-> Out 0 0 0 0 0 0 This is followed by an estimated line speed, which is an approximation of the bit rate of the line, based on the number of bytes sent and the actual time that it took to send them. OPTIONS
The options for syncloop are described in the following table: Option Parameter Default Description -c packet_count 100 Specifies the number of pack- ets to be sent in the multi- ple-packet phase. -d hex_data_byte random Specifies that each packet will be filled with bytes with the value of hex_data_byte. -l packet_length 100 Specifies the length of each packet in bytes. -s line_speed 9600 Bit rate in bits per second. -v Sets verbose mode. If data errors occur, the expected and received data is dis- played. -t test_type none A number, from 1 to 4, that specifies which test to per- form. The values for test_type are as follows: 1: Internal loopback test. Port loopback is on. Transmit and receive clock sources are internal (baud rate genera- tor). 2: External loopback test. Port loopback is off. Transmit and receive clock sources are internal. Requires a loopback plug suitable to the port under test. 3: External loopback test. Port loopback is off. Transmit and receive clock sources are external (modem). Requires that one of the local modem, the remote modem, or the remote system be set in a loopback configu- ration. 4: Test using prede- fined parameters. User defines hardware configura- tion and may select port parameters using the syncinit(1M) command. All numeric options except -d are entered as decimal numbers (for example, -s 19200). If you do not provide the -t test_type option, syn- cloop prompts for it. EXAMPLES
Example 1: A sample display of using the syncloop command. In the following command syncloop uses a packet length of 512 bytes over the first CPU port: example# syncloop -l 512 zsh0 In response to the above command, syncloop prompts you for the test option you want. The following command performs an internal loopback test on the first CPU port, using 5000 packets and a bit rate of 56Kbps: example# syncloop -t 1 -s 56000 -c 5000 zsh0 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
syncinit(1M), syncstat(1M), attributes(5), zsh(7D) DIAGNOSTICS
device missing minor device number The name device does not end in a decimal number that can be used as a minor device number. invalid packet length: nnn The packet length was specified to be less than zero or greater than 4096. poll: nothing to read poll: nothing to read or write. The poll(2) system call indicates that there is no input pending and/or that output would be blocked if attempted. len xxx should be yyy The packet that was sent had a length of yyy, but was received with a length of xxx. nnn packets lost in outbound queueing nnn packets lost in inbound queueing A discrepancy has been found between the number of packets sent by syncloop and the number of packets the driver counted as transmit- ted, or between the number counted as received and the number read by the program. WARNINGS
To allow its tests to run properly, as well as prevent disturbance of normal operations, syncloop should only be run on a port that is not being used for any other purpose at that time. SunOS 5.10 9 Mar 1993 syncloop(1M)
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy