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


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"


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

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

while [ $count -le $norec ]


        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`



cat list2.tmp




$   sh e6vax.sh

Enter dir : tmp


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
Create a single page that demonstrates an XHTML form. The form should include all the fields you feel are necessary for submitting an order of books and must include at least one

these 8 numbers (15, 20, 25, 30, 35, 40, 45, and 50) with using conditional jump

Memory Hierarchy for Linux Systems A cache line has one or more valid bit(s), tag entry and list of bytes in a block in one set of a cache, as shown below: If you were

In this exercise you will develop a small 'Pop Game' in which the user will "pop" shapes that are drawn on the screen. The game will be time based, showing a shot clock at the top

Write a program to handle a book collection. The data on each book might be title, author, publication date, book number and  cataloging details. Allow for adding or deleting books

W.A.S.S to find the maximum of three numbers Program # W.A.S.S to find the maximum of three numbers echo "Enter three No.:" read no1 read no2 read no3 if test $no1 -gt $n

Develop a socket program in UNIX/Linux that uses (i) TCP as the transport protocol and  (ii) UDP as the transport protocol for transferring  a short message between a client and  s

In this Project your task is to create a program that displays various levels of the fractal structure of the so called square shaped Sierpinski-carpet. The display of level 4 is s

CSCI 3380 Project 1 For Mano’s Computer design, we have the following flowchart for fetch and decode phases: Please write the code to simulate the computer to

Hi how can I upload my hw to you experts?