Skip to main content
Fix broken quoting
Source Link
tripleee
  • 185.2k
  • 36
  • 295
  • 342

How do you know where the value begins? If it's always the 5th and 6th words, you could use e.g.:

B=$(echo $A"$A" | cut -d ' ' -f 5-)

This uses the cut command to slice out part of the line, using a simple space as the word delimiter.

How do you know where the value begins? If it's always the 5th and 6th words, you could use e.g.:

B=$(echo $A | cut -d ' ' -f 5-)

This uses the cut command to slice out part of the line, using a simple space as the word delimiter.

How do you know where the value begins? If it's always the 5th and 6th words, you could use e.g.:

B=$(echo "$A" | cut -d ' ' -f 5-)

This uses the cut command to slice out part of the line, using a simple space as the word delimiter.

Source Link
unwind
  • 397.3k
  • 64
  • 478
  • 613

How do you know where the value begins? If it's always the 5th and 6th words, you could use e.g.:

B=$(echo $A | cut -d ' ' -f 5-)

This uses the cut command to slice out part of the line, using a simple space as the word delimiter.