Display files specified in directory in format, Programming Languages



 W.A.S.S to display all the files in a specified directory in the following format:

File  size in K        Date   Protection    Owner


Program


echo -e "Enter dir : \c"

read dirc

ls -al $dirc > list.tmp

wc -l list.tmp  > rec.tmp

norec=`awk '{print $1}' rec.tmp`

echo "REC=$norec"

count=2

echo "FILE    SIZE IN K   DATE    PROTECTION   OWNER  " > list2.tmp

echo "---------------------------------------------------" >> list2.tmp

while [ $count -le $norec ]

do

        head -$count list.tmp > list1.tmp

 

        tail -1 list1.tmp | awk '{printf "%-20s %-10d %15s %-15s %5s\n",$8,$5,$6,$1,$3}' >> list2.tmp

        count=`expr $count + 1`

 

done

cat list2.tmp

 

OUTPUT

 

$   sh e6vax.sh

Enter dir : tmp

REC=7

FILE    SIZE IN K                            DATE    PROTECTION   OWNER

-----------------------------------------------------------------------------

.                    1024               2006-11-10 drwxr-xr-x      linux

..                   1024               2006-11-10 drwxr-xr-x      linux

shv                0                     2006-11-10 -rw-r--r--       linux

j2me              0                    2006-11-10 -rw-r--r--       linux

anaconda       14                  2006-11-10 -rw-r--r--       linux
temp1            1024              2006-11-10 drwxr-xr-x      linux

Posted Date: 9/26/2012 8:45:00 AM | Location : United States







Related Discussions:- Display files specified in directory in format, Assignment Help, Ask Question on Display files specified in directory in format, Get Answer, Expert's Help, Display files specified in directory in format Discussions

Write discussion on Display files specified in directory in format
Your posts are moderated
Related Questions
This case will lead to similar problem that we've had all other time we've run in double roots or double eigenvalues. We only find a single solution and will require a second solut

Create a visualization (programming project) and demonstrate it in the class. The project should be related to distributed systems. (A distributed system consists of multiple auton

MVC Architecture Model/view/controller (MVC) is a program structure, currently regarded an executive design used in program technological innovation. The design isolates "domain lo

What is "No_Data_Found" in Oracle?

Project2: A Simple Distributed Computing Platform (Due at 11:59:59pm on 04/12/2012 (EST)) Description: You are asked to develop a replicator (client) that distributes a large job

On December 27, 2011, Seymour Gravel, at the urging of his wife, Mary Walford, has brought you his preliminary figures for his business. Seymour carries on a business writing and e

Each of the following two procedures defines a method for adding two positive integers in  terms of the procedures inc, which increments its argument by 1, and dec, which decrement

I need help getting started with a class project of creating a project in the Perl programming language. I was thinking of maybe doing an employee directory

(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digit

1. Modify your solution to #8 so that if an ellipse is touched by the mouse, it turns permanently green.Bonus (up to +5): a green ellipse stops moving, but recovers after 5 seconds