LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2013, 06:17 AM   #1
rajeevdvedi2006
LQ Newbie
 
Registered: May 2013
Posts: 1

Rep: Reputation: Disabled
linux Script required for word by word comaprison from 2 carat separated files.


I have 2 carat separated files which consist of userid(first field) and his corresponding entry in carat separated.I want the the output which is given as below.
I required first field as userid and their all differences in carat separated.

FILE 1: A1.TXT

A1^admin=false^login=true^su=true^daemon=false^rlogin=true^sugroups=ALL
A3^admin=false^login=true^su=true^daemon=true^rlogin=true^sugroups=ALL
A5^admin=false^login=true^su=true^daemon=true^rlogin=true^sugroups=ALL

FILE 2: A2.TXT

A1^admin=false^login=false^su=true^daemon=true^rlogin=true^sugroups=ALL
A3^admin=true^login=true^su=true^daemon=true^rlogin=true^sugroups=ALL
A5^admin=true^login=true^su=true^daemon=true^rlogin=false^sugroups=ALL


OUTPUT SHOULD BE AS GIVEN BELOW:

mismatch! file 1: A1^login=true^daemon=false
file 2: A1^login=false^daemon=true

mismatch! file 1: A3^admin=false
file 2: A3^admin=true

mismatch! file 1: A5^admin=false^rlogin=true
file 2: A5^admin=true^rlogin=false

I will be very thankful if anyone can post the linux shell script for the same.
Regards,
Raj

Last edited by rajeevdvedi2006; 05-29-2013 at 06:31 AM. Reason: Small correction done.
 
Old 05-29-2013, 06:24 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
We prefer to help people. Have a go and come back if you get stuck.Make sure you post your code using code tags https://www.linuxquestions.org/quest...do=bbcode#code.

You may find these useful
http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

Good Luck
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Find/Replace shell script that replaces word with other word in text, filenames yanom Programming 8 09-12-2012 12:29 AM
bash shell script read file word by word part 2 justina Programming 7 01-25-2011 01:19 PM
How can i read two files word by word at a time using any loop by shell script? vaibhavs17 Programming 16 03-19-2010 03:48 AM
word by word comparison in two files using loop in shell script vaibhavs17 Programming 2 03-05-2010 07:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration