Sponsored Content
Top Forums Shell Programming and Scripting Reversing file order using SED Post 29100 by Optimus_P on Monday 30th of September 2002 09:23:52 AM
Old 09-30-2002
why use the wrong utility to do the job?

man sort.

and if you teacher says not useing sed is incorrect. tell him he must be one of those people who like to walk to work instead of drive to work.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using sed and regex to reverse order???

so i have been trying to learn how to manipulate text on my own and have gotten stumped... let's say i have a text file that says (highly simplified): people ordinary How would swap the order of the words.. I know i need to use sed and some kind of back reference but cannot make it... (2 Replies)
Discussion started by: urtherhoda
2 Replies

2. Shell Programming and Scripting

output string in reversing order

If I have string { I_love_shell_scripts} anyone knows how to have output {stpircs_llehs_evol_I} by using shell and perl ?I know in perl, there is reverse() funcation, but can it be done by not using reverse()? (3 Replies)
Discussion started by: ccp
3 Replies

3. UNIX for Dummies Questions & Answers

Changing the order using sed

I have a text "abc def ghi" and I want to get it as "def abc ghi" I am using this echo "abc def ghi" | sed 's/\(*\)\(*\)/\2\1/' But I am not able to get the output, could anyone help me. Thanks (9 Replies)
Discussion started by: venu_nbk
9 Replies

4. Shell Programming and Scripting

reversing a line

Hi, I could not find this anywhere and I am wondering if someone knows a quick way of doing this. So heres the problem... I have a row that looks like this (an example): 5 4 3 2 1 What I want to do is reverse it so it looks like this: 1 2 3 4 5 Does anyone know the simple unix... (7 Replies)
Discussion started by: kylle345
7 Replies

5. Shell Programming and Scripting

sed or awk to order a file

Hi - I have a file with lots of lines in that I need to order based on the number of commas! e.g the file looks something like :- cn=john,cn=users,cn=uk,dc=dot,dc=com cn=john,cn=users,dc=com cn=users,cn=groups,dc=com cn=john,cn=admins,cn=users,cn=uk,dc=dot,dc=com... (4 Replies)
Discussion started by: sniper57
4 Replies

6. Shell Programming and Scripting

reversing order of lines in a file

how can i reverse the line order in text files? (but total number of the lines is not constant ) for example i have a file like this: line1 line2 line3 . . lineN i wantto make it like this: lineN . . . line3 (26 Replies)
Discussion started by: gfhgfnhhn
26 Replies

7. UNIX for Dummies Questions & Answers

Reversing line and word order using awk

Hello, I am new to awk and I was wandering if I could reverse line and word order from a text file using awk. I figured out how to do them both separately, but can't quite figure out how to mix them. Example: Input file: dog cat mouse 1 2 3 I am new to awk Output of the awk program:... (3 Replies)
Discussion started by: blink_w
3 Replies

8. Shell Programming and Scripting

Reversing text order of each line of a file in UNIX

My input is: hello how are you my chemistry book is lost what is up etc... And I want the output to be: you are how hello lost is book chemistry my up is what .... I found an earlier response to a similar question but it was not accurate as it required a certain string length for each line (2 Replies)
Discussion started by: Heidi Heweidy
2 Replies

9. Shell Programming and Scripting

sed string with any order

Hi, i have a strange prob. log file contains ip, protocol, user name, agent . these can be in any order. If log contains the above order able to fetch all details but if details are in diff order not able to fetch all details. using below command. grep -A50 "Entry " "/logs/file.log" \ |grep... (6 Replies)
Discussion started by: Satyak
6 Replies

10. Shell Programming and Scripting

sed - searching token in certain order

Hello. I would like to write a bash function which would return "true" if the search succeed else return anything else. something like if ] ; then exit 1 fi function my_funct () { find first occurrence $2 in $1 if not found return "false" from that position,... (6 Replies)
Discussion started by: jcdole
6 Replies
MLXCTL(8)						    BSD System Manager's Manual 						 MLXCTL(8)

NAME
mlxctl -- Mylex DAC960 family management utility SYNOPSIS
mlxctl [-f dev] [-v] [-a] status [drive] [...] mlxctl [-f dev] [-a] detach [drive] [...] mlxctl [-f dev] [-a] check [drive] [...] mlxctl [-f dev] rebuild channel:target mlxctl [-f dev] cstatus mlxctl [-f dev] rescan mlxctl [-f dev] config DESCRIPTION
The mlxctl utility performs status monitoring and management functions for Mylex DAC960 RAID controllers and attached devices. The following options are available: -a Apply the action to all drives attached to the controller. -f dev Specify the control device to use. The default is /dev/mlx0. -v Increased verbosity. The following commands are available: cstatus Display the controller's current status. status Display the status of the specified drives. This command returns 0 if all drives tested are online, 1 if one or more drives are critical and 2 if one or more are offline. rescan Re-scan the logical drive table, and attach or detach devices from the system as necessary. detach Detach the specified drives. Drives must be unmounted and unopened for this command to succeed. check Initiate a consistency check and repair pass on a drive that provides redundancy (e.g., RAID1 or RAID5). This command returns imme- diately. The status command can be used to monitor the progress of the check. rebuild Rebuild onto the specified physical drive. Note that there can be only one running rebuild operation per controller at any given time. This command returns immediately. The cstatus command can be used to monitor the progress of the rebuild. config Write the current system drive configuration to stdout. EXAMPLES
Display the status of drive ld3 attached to the controller mlx1: mlxctl -f /dev/mlx1 -v status ld3 SEE ALSO
ld(4), mlx(4) HISTORY
The mlxctl command first appeared in NetBSD 1.5.3, and was based on the mlxcontrol utility found in FreeBSD. BUGS
Modifying drive configuration is not yet supported. Some commands do not work with older firmware revisions. Error log extraction is not yet supported. BSD
April 10, 2000 BSD
All times are GMT -4. The time now is 01:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy