The task is i have a folder which has some text files
i need to write a shell script which takes this folder as input and in the out put it should give
me the filenames,lastmodified date,and the lastline in each particular file
help me asap

9 Years
Discussion Span
Last Post by noobguy

hey i have written the following code can any of u assure me that it works perfect

# !/bin/bash
echo -n "Enter Your Folder With Full Path : "
read path
cd $path
ls -c -lt | more
tail -1 *.*


Just from a quick look I can tell you that unless $User inputs an absolute path or whatever your looking for is in your dir it will error out there also I dont think it is a good idea to call that var $path unless what you have posted is pseudo code. Lastly I think the tail command might need tweaking

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.