Skip to main content
deleted 1 character in body
Source Link
Stack EG
  • 1.8k
  • 1
  • 14
  • 13

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g'' 
  • -n means maximum arguments per line.

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g' 
  • -n means maximum arguments per line.

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /' 
  • -n means maximum arguments per line.

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3
added 44 characters in body
Source Link
Stack EG
  • 1.8k
  • 1
  • 14
  • 13

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g' 
  • -n means maximum arguments per line.

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g' 

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g' 
  • -n means maximum arguments per line.

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3
Post Undeleted by Stack EG
added 147 characters in body
Source Link
Stack EG
  • 1.8k
  • 1
  • 14
  • 13

please try this,

sed 's/rrcpdI have saved the given sample output in file /\nHostname1 rrcpdtmp/g'test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g' 

For example;

echocat "rrcpd/tmp/test.txt 17 rrcpd| 0"xargs -n 2 | sed 's/rrcpd^/\nHostname1Hostname1 rrcpd/g'
  
Hostname1 rrcpd 17 
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3

please try this,

sed 's/rrcpd/\nHostname1 rrcpd/g'

For example;

echo "rrcpd 17 rrcpd 0" | sed 's/rrcpd/\nHostname1 rrcpd/g'
 
Hostname1 rrcpd 17 
Hostname1 rrcpd 0

please try this,

I have saved the given sample output in file /tmp/test.txt.

 xargs -n 2 | sed 's/^/Hostname1 /g' 

For example;

cat /tmp/test.txt  | xargs -n 2 | sed 's/^/Hostname1 /g' 
Hostname1 rrcpd 17
Hostname1 rrcpd 0
Hostname1 Cheese 3
Hostname1 cakes 8
Hostname1 Cats 9
Hostname1 dogs 3
Post Deleted by Stack EG
Source Link
Stack EG
  • 1.8k
  • 1
  • 14
  • 13
Loading