Sponsored Content
Full Discussion: For or while?
Top Forums Shell Programming and Scripting For or while? Post 302972346 by sam_bd on Wednesday 4th of May 2016 08:38:33 AM
Old 05-04-2016
Thanks for your reply RudiC. I just tried with do-while loop.
Code:
#!/bin/ksh
while read i
do
ls -lrt $i
done < files.txt

I'm getting desired output of long listing of files via "ls -lrt" command. But i need to upgrade this one step ahead by including probably an if-else condition (pls correct if i'm wrong) to check if a particular file exists or not. Could you please suggest?
 
PLS(1)							   http://synce.sourceforge.net/						    PLS(1)

NAME
pls - list directory contents SYNOPSIS
pls [-a] [-R] [-d LEVEL] [-p DEVNAME] [-h] [DIRECTORY] DESCRIPTION
pls list the contents of a directory on a device connected through SynCE. Forward slashes ('/') on the command line are converted to backward slashes (''). File attributes A Archive C Compressed D Directory H Hidden I In ROM M ROM module (can only be executed, not read!) N Normal R Read-only S System T Temporary OPTIONS
-d LEVEL Set debug log level: 0 - No logging (default) 1 - Errors only 2 - Errors and warnings 3 - Everything -p DEVNAME Use the device with the given name, instead of the default. -a Show all files including those marked as hidden. -R Recursively list subdirectories. -h Display help message. DIRECTORY The full path name to the directory. Wild cards are allowed, but only for the trailing part of the path, and should be protected from the shell. If this parameter is relative, it is assumed to be relative to the "My Documents" folder. Similarly, if this parame- ter is omitted, the contents of the "My Documents" folder is listed. AUTHOR
This manual page was written by David Eriksson <twogood@users.sourceforge.net>. SEE ALSO
synce(1) pcp(1) pls(1) prm(1) pmkdir(1) prmdir(1) The SynCE project November 2002 PLS(1)
All times are GMT -4. The time now is 04:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy