![]() |
|
|
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 |
| passing argument to shell script that reads user inputs | patjones | Shell Programming and Scripting | 6 | 04-10-2009 06:42 PM |
| passing Argument | Shahul | Shell Programming and Scripting | 4 | 11-13-2008 08:50 AM |
| Problem when passing argument to a shell script | sumesh.abraham | Shell Programming and Scripting | 9 | 12-13-2006 12:07 PM |
| Passing argument from one script to other | lloydnwo | Shell Programming and Scripting | 3 | 10-27-2005 03:06 PM |
| Passing argument to awk script | AkumaTay | UNIX for Dummies Questions & Answers | 1 | 08-03-2001 12:12 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need to run the script by argument passing
Hi All, I have a question regarding running this script by passing an argument, for example ./ShellParse.sh sun, how do i do that? So i want when i pass argument sun, it shouild execute things inside the for loop. I want to support some other platforms too, so there are more for loops to come. How do i do that? Thanks Adsi Code:
#!/bin/sh
ECHO=/bin/echo
FIND=/bin/find
AWK=/bin/awk
LS=/bin/ls
GREP=/bin/grep
ROOT_PATH=/net/icebox/vol/local_images/spins
STREAM_PATH=$ROOT_PATH/7.1
SUN_PLATFORM=`$FIND $STREAM_PATH . -depth -name ShareableEntities | $AWK -F"/" '{if($10 ~ /sun
5/) print $0}'`
for i in $SUN_PLATFORM
do
$ECHO $i
$LS $i | $GREP .su | $AWK -F"_" '{print $1}'
done | sort | uniq -c
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|