Sed find and replace ip addresses in a file
Closed
nick
-
Aug 14, 2009 at 11:11 PM
jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 - Aug 15, 2009 at 09:52 AM
jipicy Posts 40842 Registration date Wednesday August 27, 2003 Status Moderator Last seen August 10, 2020 - Aug 15, 2009 at 09:52 AM
Related:
- Sed change ip address in file
- Windows 10 iso file download 64-bit - Download - Windows
- Phone ip address - Guide
- Ps3 failed to obtain ip address - Guide
- Kmspico zip file download - Download - Other
- Send message using cmd ip address windows 10 - Guide
2 responses
jipicy
Posts
40842
Registration date
Wednesday August 27, 2003
Status
Moderator
Last seen
August 10, 2020
17
Aug 15, 2009 at 09:52 AM
Aug 15, 2009 at 09:52 AM
jp@MDK:~/tmpfs ssh$ cat file1.out 044=10.1.10.200 10.2.10.200 jp@MDK:~/tmpfs ssh$ sed '/^044/ s/=.*/=192.168.1.200 192.168.2.200/' file1.out 044=192.168.1.200 192.168.2.200 jp@MDK:~/tmpfs ssh$ sed -i.bak '/^044/ s/=.*/=192.168.1.200 192.168.2.200/' file1.out jp@MDK:~/tmpfs ssh$ cat file1.out 044=192.168.1.200 192.168.2.200 jp@MDK:~/tmpfs ssh$ cat file1.out.bak 044=10.1.10.200 10.2.10.200 jp@MDK:~/tmpfs ssh$;-))
jipicy
Posts
40842
Registration date
Wednesday August 27, 2003
Status
Moderator
Last seen
August 10, 2020
17
Aug 15, 2009 at 05:19 AM
Aug 15, 2009 at 05:19 AM
Hi,
What is the common pattern ? 044 or 10.1.10.200 ?
What is the common pattern ? 044 or 10.1.10.200 ?