![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading specific contents from 1 input files and appending it to another input file | sksahu | Shell Programming and Scripting | 5 | 01-14-2009 06:09 AM |
| passing an input parameter like date thru jcl using BPXBATCH utility | Sujatha Gowda | SUN Solaris | 0 | 06-03-2008 08:23 AM |
| awk/input parameter | wannalearn | Shell Programming and Scripting | 3 | 07-30-2007 01:42 PM |
| Input parameter format | mpang_ | Shell Programming and Scripting | 1 | 04-12-2006 04:34 AM |
| Shell script with input parameter | jhmr7 | UNIX for Dummies Questions & Answers | 1 | 07-13-2005 12:04 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
How to Get the File Input from Parameter
Code:
pdir=`pwd`
if [ $# -lt 1 ]; then
echo current directory $pdir
ls -altr
echo
fi
for f in $*
do
# directory
if [ -d $f ]; then
echo current directory $f
cd $f
ls -latr
echo
fi
# but you can test file/dir
# regular file only
if [ -f $f ]; then
echo current directory $pdir
ls -altr $f
echo
fi
done
if i enter this below on the command line Code:
sh dir_file_list.sh /u02/app/eatv/dev/out/*.txt Code:
current directory /export/home/ccalftdv/apps -rw-r--r-- 1 ccalftdv ccalogrp 7 Jun 30 09:30 /u02/app/eatv/dev/out/ sample.txt $ |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|