Skip to main content
add comment to question (and fix grammar)
Source Link
ctrl-alt-delor
  • 28.8k
  • 11
  • 66
  • 113

I have a file named "rules.txt", this file contains the following below:

Jones 2     IP1   1P2

The thing now is that "Jones 2" is supposed to be one word. How do I get my script to understand this?

All lines of the file are consistent. I basically have NAT rule names, start ip address and end ip address. The NAT rule names are separated by spaces and there is a tab between the IP addresses.

I don't want to do any splitting. I just want to read the "Jones 2" and also read IP1 and IP2 as 3 separate things in my while loop.

I have a file named "rules.txt", this file contains the following below:

Jones 2     IP1   1P2

The thing now is that "Jones 2" is supposed to be one word. How do I get my script to understand this?

I have a file named "rules.txt", this file contains the following below:

Jones 2     IP1   1P2

The thing now is that "Jones 2" is supposed to be one word. How do I get my script to understand this?

All lines of the file are consistent. I basically have NAT rule names, start ip address and end ip address. The NAT rule names are separated by spaces and there is a tab between the IP addresses.

I don't want to do any splitting. I just want to read the "Jones 2" and also read IP1 and IP2 as 3 separate things in my while loop.

Source Link
bonafideaf
  • 133
  • 2
  • 7

How to cat and read white spaces from file

I have a file named "rules.txt", this file contains the following below:

Jones 2     IP1   1P2

The thing now is that "Jones 2" is supposed to be one word. How do I get my script to understand this?