Avatar of radix655
radix655

asked on 

appending to a line that doesn't match grep

I have a file which contains:
ss1 dest1 dest2 dest3
ss2 dest2 dest4


I get the dest2 for ss1 say from reading another file.
Then I will not append dest2 to ss1

Output file:
ss1 dest1 dest2 dest3
ss2 dest2 dest4

If I get the dest4 for ss1 say

Output file:
ss1 dest1 dest2 dest3 dest4
ss2 dest2 dest4

How to achieve this? Please suggest.
Shell ScriptingLinuxLinux OS Dev

Avatar of undefined
Last Comment
woolmilkporc
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Linux
Linux

Linux is a UNIX-like open source operating system with hundreds of distinct distributions, including: Fedora, openSUSE, Ubuntu, Debian, Slackware, Gentoo, CentOS, and Arch Linux. Linux is generally associated with web and database servers, but has become popular in many niche industries and applications.

71K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo