Skip to main content
added 23 characters in body; edited tags
Source Link
Kevin
  • 41.7k
  • 17
  • 91
  • 113

How tocan I change lines in linux/basharound using the command line? 
e.g. I have thisthese lines:

    Acct-Status-Type = Start
    User-Name = "37XXXXXXX"
    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"

NeedI need to change the order to this:

    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"
    User-Name = "37XXXXXXX"
    Acct-Status-Type = Start

AlsoI need to do this by one command, sed, awk, perl or smth like it. Thankssomething like that.

How to change lines in linux/bash? e.g. I have this lines:

    Acct-Status-Type = Start
    User-Name = "37XXXXXXX"
    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"

Need to change to this:

    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"
    User-Name = "37XXXXXXX"
    Acct-Status-Type = Start

Also need to do this by one command, sed, awk, perl or smth like it. Thanks.

How can I change lines around using the command line? 
e.g. I have these lines:

    Acct-Status-Type = Start
    User-Name = "37XXXXXXX"
    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"

I need to change the order to this:

    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"
    User-Name = "37XXXXXXX"
    Acct-Status-Type = Start

I need to do this by one command, sed, awk, perl or something like that.

edited title
Link
daisy
  • 55.9k
  • 80
  • 253
  • 402

Changing Reordering strings in linux

Source Link

Changing strings in linux

How to change lines in linux/bash? e.g. I have this lines:

    Acct-Status-Type = Start
    User-Name = "37XXXXXXX"
    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"

Need to change to this:

    Event-Timestamp = "Apr 12 2013 15:56:55 AMT"
    User-Name = "37XXXXXXX"
    Acct-Status-Type = Start

Also need to do this by one command, sed, awk, perl or smth like it. Thanks.