Display files specified in directory in format, Programming Languages

Assignment Help:



 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


Related Discussions:- Display files specified in directory in format

determine if dna sequence is periodic or not, A string s is said to be per...

A string s is said to be periodic with a period α, if s is α k for some k > 2. (Note that α k is the string formed by concatenating k times.) A DNA sequence s is called a tande

Explain the use of sync and fsck, Problem 1 Define the architecture of ...

Problem 1 Define the architecture of UNIX operating system with appropriate diagram Problem 2 Define the term inter-process communication. What are several approaches t

Calculate the sum of negative elements of specified column, Write a program...

Write a program that will generate 25 DWORD values in the range from +/-50 representing a two dimensional array of size 5 x 5. It should then display the array as a table (5 x 5) b

Prolog assignment, I have constantly been emailing to get the task i had pa...

I have constantly been emailing to get the task i had paid for to be done correctly but no replies from anyone. Not even one acknowledging my emails. Been phoning all the way from

Create a fortran program for represent a convex polygon, In analytical geom...

In analytical geometry, a convex polygon can be represented by the Cartesian coordinates of its vertices, x and y. Assume such data of a polygon are stored in a file called "vertic

Develop a context diagram and use case diagram, Develop (i) a context diagr...

Develop (i) a context diagram and (ii) a use case diagram to model the following functionalities of NetFlix. Netflix is an online video/DVD renting company. A customer desiring

Program on car purchasing simulation, Introduction A new online syst...

Introduction A new online system for purchasing carsis being designed and you have been contracted to write a C# console application program that models the proposed functio

Data analytics, can i get assignments on Data analytics?

can i get assignments on Data analytics?

Visual logic, how much it will cost? i need learn how to make rightsided tr...

how much it will cost? i need learn how to make rightsided triangle in forloop

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd