Logo 
Search:

Unix / Linux / Ubuntu Answers

Ask Question   UnAnswered
Home » Forum » Unix / Linux / Ubuntu       RSS Feeds
  on Nov 24 In Unix / Linux / Ubuntu Category.

  
Question Answered By: Adah Miller   on Nov 24

One of the possible Ans is (Tested on Solaris it works)

Answer to your both Questions in single Scr!!!

#!/bin/sh
date > tempdate
temp=`awk '{print $2}' tempdate`;
rm tempdate;
echo $temp;
for var in $temp
do
grep -i $var myfile | wc -l;
done;

Replace <myfile> with your absolute file path and <wc -l> whatever like <sort> or anything

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on basic shell script problem Or get search suggestion and latest updates.


Tagged: