I am doing this with below command but not satisfied, I know there is better way to do this but need right direction.
I doubt that you are doing it with the script you posted; there are errors in that script. When posting code, use the exact code. Cut and paste it, do not retype it.
Quote:
That is almost always the wrong way to read a file.
You are not reading it a line at a time, but a word at a time.
Use a while loop:
Quote:
There must be no spaces around the equals signs.
You do not need an external command to split a line. Use the shell's parameter expansion or IFS and set:
There's usually not much reason to use cut when the read builtin can handle delimiters more elegantly. Here it takes two delimiters, period and space, to split the string into words and individual numbers at the same time. It also checks when the first three change and prints out the address entire, as your output data suggests you want.
I doubt that you are doing it with the script you posted; there are errors in that script. When posting code, use the exact code. Cut and paste it, do not retype it.
I was looking for right direction and you gave it me... thank you!
Quote:
Originally Posted by Corona688
There's usually not much reason to use cut when the read builtin can handle delimiters more elegantly. Here it takes two delimiters, period and space, to split the string into words and individual numbers at the same time. It also checks when the first three change and prints out the address entire, as your output data suggests you want.
Hi guys thanks for the help for my previous posts.Now i have a requirement that i download a XMl file which has UTC time stamp.I need to convert UTC time into Unix server timezone.
For ex if the time zone of unix server is CDT then i need to convert into CDT.whatever may be the system time... (5 Replies)
Hi,
I am new to linux stuff. I want to use linux iptables to configure rule so that all my incoming traffic with protocol "tcp" is forwarded to the "FORWARD CHAIN". The traffic i am dealing with has destination addresss of my machine but i want to block it from coming to input chain and somehow... (0 Replies)
I have two physical servers, with zones that mount local storage.
We were using "raw device" in the zonecfg to point to a metadevice on the global zone (it was not mounted in the global zone at any point).
It failed to mount on every boot because the directory existed in the zone.
I... (6 Replies)
Please Help Me! about the problem down under.
I have 2 files with nearly the same characteristics, I have to convert one to the other format or the other format to one's format. I want to write it with awk.
The first file contain lines like this:
300000001#A#Y#Y#Y#Y
The other file contain... (4 Replies)
HI GUrus,
I am very mcuh new for this forum ....i need you all guys help for resolving my queries.
As i have DNS server , platform is sunsolaris----8. We are using that serevr for resolving all network nodes.
I am going to explain the process what i am following ....
I could have... (2 Replies)
I've got an old v880 running Sol10 that is going to another location. When the system moves, the domainname in resolv.conf will change also. My DBA's are going through the steps of installing Oracle on the box and they want the install program to resolve the hostname is if the box were already in... (2 Replies)
Hi,
I have a primary/slave Bind 9 setup running on a Solaris 10 platform. Everything is hunky dorey, except for when I make a zone file change and up the serial the file that is transferred to the slave looses all its comments, and the entries are place in alphabetical order.
I administer many... (1 Reply)
I have a file, can I just modify the <number> field and delete the 3rd number and move 4th number to 3rd.. (surely, delete the last digit)?
<john>
<Number>11 20 03 22 23 21 91 00 F0</Number>
<peter>
<Number>12 20 03 20 99 21 91 20 F0</Number>
<ken>
<id>
<Number>10 21 03 21 78 21 92... (6 Replies)
I've set up a .forward file on a few identical servers that we have (all identical .forward file as well) but only one server is forwarding any of my unix mail (mail generated by cron) to my internet account.
Because these servers (5) are all identical in terms of aix versions, etc., I do not... (3 Replies)