In a message dated 3/31/2006 12:11:32 P.M. Eastern Standard Time,  
[EMAIL PROTECTED] writes:

Good  Afternoon:

I need to write a script/execute a command and  don't have a lot
of time to research.  The script will take in the  output from the ls -al
command and evaluate only the first 10 characters  (the file type and
permissions). I want to copy out all the lines that have  -********T or
-********t  in the file permissions indicators.   What is the best to do
this?


nawk/awk is good enough, in my view.
 
ls -al | awk '{if ((substr  
($1,length($1),1)=="T")||(substr($1,(length($1),1)=="t")){print $0}}'
 
There are shorter ways to do this, but I don't have a Solaris machine in  
front of me and can't test them. 
 
As always, untested code has to be buggy.  Contact me if it  doesn't work.
_______________________________________________
Solaris-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/solaris-users

Reply via email to