+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    1

    simple script....complex migraine

    i am stuck on a very simple bash shell script for a linux admin class...need to add any number of parameters passed in from the command line...can get it to do it with 0,1, and 2 params, but no more without hard coding it(i.e $1 + $2 + $3 + $4 . . )....help pls

  2. #2
    may contain mild peril SpookyEddy's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    3,329
    The following works ok for me no matter how many arguments I have.
    Code:
    echo "Script invoked with $# arguments"
    
    for arg in $*
    do
        echo $arg
    done
    Regards

    ed

Quick Reply Quick Reply

If you are already a member, please login above.

What is 10 and 5 added together?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Drive Image Script Please, I need help!
    By guisong in forum Applications and Operating Systems
    Replies: 0
    Last Post: January 15th, 2003, 05:35 PM
  2. Simple bash script won't work
    By BFlurie in forum Applications and Operating Systems
    Replies: 3
    Last Post: November 18th, 2002, 09:46 PM
  3. script to query a running process
    By cornhusker in forum General Tech Discussion
    Replies: 0
    Last Post: November 15th, 2002, 10:22 PM
  4. Script Help PhP
    By Legacy in forum Webmastering and Programming
    Replies: 6
    Last Post: November 9th, 2002, 09:53 PM
  5. W2K logon script problem
    By DVNT1 in forum Technical Support
    Replies: 3
    Last Post: September 13th, 2002, 04:39 PM

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright 2014 All Enthusiast, Inc