ronitreddy Posted July 21, 2011 Report Posted July 21, 2011 Guys naku UNIX lo koncham dbts unnayi ..koncham help cheyandi plsss1) How to test whether a shell script has been succeeded or not ?2) I have 2 text files say file1.txt and file2.txt. file1.txt holds 10000 records. Some of the sample records for file1.txt were shown belowabc....123456789bertgfd.....758457485hfdfdfd.....638564658hfdf where 123456789,758457485, 638564658 are account numbers.for file2.txt, some of the sample records were shown below:hfdifdifjdkfjdkd7484737437hfhsdlfhdhfsdyruerueuryeuyr874583783ureoiruueooehhkdfhkhfkhdfkk638564658klfldkflkdlkflkd where 7484737437,874583783, [b]638564658[/b] are account numbersI need to find the common records that were present in file2.txt with respect to file1.txt..3)How can we search for a file in a subdirectory ?Say for example I need to list out all the files by the name 'AFDB' in the path /usr/forum/home/directory CITI#H@ CITI#H@ CITI#H@ CITI#H@ CITI#H@ thankyou thankyou thankyou
lover Posted July 21, 2011 Report Posted July 21, 2011 1. [url=http://www.cyberciti.biz/tips/debugging-shell-script.html]http://www.cyberciti.biz/tips/debugging-shell-script.html[/url] may helpful
ronitreddy Posted July 21, 2011 Author Report Posted July 21, 2011 [quote author=lover link=topic=214654.msg2636754#msg2636754 date=1311206921]2 . diff -- help vadu ba[/quote]cut -c5-11 file1.txt>Acut -c10-15 file2.txt>B chesthe account numbers osthayi baa..tarwathaaa em cheyali baa..
ronitreddy Posted July 21, 2011 Author Report Posted July 21, 2011 [quote author=lover link=topic=214654.msg2636762#msg2636762 date=1311207031]1. [url=http://www.cyberciti.biz/tips/debugging-shell-script.html]http://www.cyberciti.biz/tips/debugging-shell-script.html[/url] may helpful[/quote]Thanks baa..but i cudnt find the answer cry@fl cry@fl
ronitreddy Posted July 21, 2011 Author Report Posted July 21, 2011 [quote author=lover link=topic=214654.msg2636784#msg2636784 date=1311207373]3 find / -name 'filename'searches all root[/quote] thankyou thankyou CITI_$D# CITI_$D# you rock you rock
lover Posted July 21, 2011 Report Posted July 21, 2011 [quote author=ronitreddy link=topic=214654.msg2636785#msg2636785 date=1311207411]Thanks baa..but i cudnt find the answer cry@fl cry@fl[/quote]may be silly but use vim editor test for various inputs correct oo kado chodu china script aite works well and fine
lover Posted July 21, 2011 Report Posted July 21, 2011 [quote author=ronitreddy link=topic=214654.msg2636783#msg2636783 date=1311207352]cut -c5-11 file1.txt>Acut -c10-15 file2.txt>B chesthe account numbers osthayi baa..tarwathaaa em cheyali baa..[/quote]sry comm --help vadi diff kadu
Gachibowli_Diwakar Posted July 21, 2011 Report Posted July 21, 2011 ba .. oka doubt .. 1st file.. 2nd file lo konni records same untaaya ? when I say records line motham same untundha on both files like below12345677rgnjvfnvjf in file1.txt12345677rgnjvfnvjf in file2.txt
lover Posted July 21, 2011 Report Posted July 21, 2011 [quote author=Musugu_Veerudu link=topic=214654.msg2636823#msg2636823 date=1311207946]ba .. oka doubt .. 1st file.. 2nd file lo konni records same untaaya ? when I say records line motham same untundha on both files like below12345677rgnjvfnvjf in file1.txt12345677rgnjvfnvjf in file2.txt[/quote] sCo_^Y inko dout similar ante line to line ahh leka line to each line ahh
Gachibowli_Diwakar Posted July 21, 2011 Report Posted July 21, 2011 for the 1st one .. script last lo echo statement pettey ba .. inka kadhu anukunte .. madhya loops lo konni echo statements pettuko .. telisipothundhi .. execute aindha ledha ani
Gachibowli_Diwakar Posted July 21, 2011 Report Posted July 21, 2011 [quote author=lover link=topic=214654.msg2636831#msg2636831 date=1311208051] sCo_^Y inko dout similar ante line to line ahh leka line to each line ahh[/quote]line in file1.txt ni anni lines in file2.txt tho compare cheyyaali ante .. cat file1.txt |while compdogrep $comp file2.txt >> matches_found.txtdonesomething similar to above logic should work
Recommended Posts