Shell Script required for the below script | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Shell Script required for the below script

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-05-2012
hemanthsaikumar hemanthsaikumar is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 13 May 2013, 12:29 AM EDT
Posts: 40
Thanks: 7
Thanked 0 Times in 0 Posts
Shell Script required for the below script

please solve my problem

i have a sample input file as
A
A
A
A
B
B
B
B
B
C
C
C
C
C

i want the output such that if the count of A or B or C is greater than 3
A
A
A
B
B
B
C
C
C

if the count of A is less than 3 i.e if the input file is like
A
A
B
B
B
B
C
C
C

then A should append B and the output file should be
A
A
B
B
B
B
C
C
C

the above output should repeat for both B and C too if the count of B and C is also less than 3

thanks in advance
sai
Sponsored Links
    #2  
Old 12-05-2012
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 16 April 2014, 6:02 AM EDT
Location: in der Schweiz
Posts: 8,322
Thanks: 312
Thanked 1,013 Times in 886 Posts
What have you tried so far? Where are you stuck?
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help required with shell script bala123 Shell Programming and Scripting 4 03-15-2012 03:46 AM
Shell script is required at1700 Shell Programming and Scripting 3 07-17-2011 10:05 PM
Shell script help required max29583 Shell Programming and Scripting 2 07-16-2008 06:28 AM
shell script required sethunath Linux 1 07-07-2007 05:04 AM
shell script required sethunath Shell Programming and Scripting 4 07-06-2007 03:39 AM



All times are GMT -4. The time now is 02:28 PM.