![]() |
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 |
| check written data | Hitori | Linux | 0 | 07-22-2006 08:46 AM |
| Simple shell script to be written | shsandeep | Shell Programming and Scripting | 6 | 07-17-2006 02:46 AM |
| Checking a file is not being written to | kanejm | Shell Programming and Scripting | 14 | 01-20-2006 08:29 AM |
| Operating on a file being written by another application | GMMike | UNIX for Dummies Questions & Answers | 3 | 02-01-2005 04:06 PM |
| File being used/written | sanjay92 | UNIX for Dummies Questions & Answers | 4 | 10-13-2001 01:31 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
written a srcipt with 2 arguments
hello all
pls can anybody point me a direction of capturing 2 arguments: one a line of text the other is a file. In paticular how can i get the file so for exampls, i create a script called monalisa monalisa this is an angel from the 7th heaven booboo where monalisa is the script name, booboo is the name of the file and the rest are the line of text.] can any body help. |
|
|||||
|
set -A ARGS $@ defines ARGS as an array and initializes it with the script arguments.
$@ is the list of arguments itself. FILE=${ARGS[$(expr $# - 1)]} assigns the last argument to the FILE variable. This is the way arrays are managed on ksh $# is the number of arguments, so expr $# -1 is the position of the last one within the array Is this homework or something? Have a look to rule #6 on: Simple rules of the UNIX.COM forums: My intention was to give you some hints so try first to do it for yourself, then ask the forum. Regards. Last edited by grial; 04-29-2008 at 05:17 AM.. |
| Sponsored Links | ||
|
|