Solved

finding out the number of parameters entered

Posted on 2004-08-22
2
195 Views
Last Modified: 2010-04-21
hi, i would like to know how i can echo to screen the number of parameters entered in a bourne shellscript program

ie. if the person types "hello hello hello hello hello" i want it to echo to screen "5 parameters were entered"

any help appreciated, thanks
0
Comment
Question by:seremaz
2 Comments
 
LVL 11

Accepted Solution

by:
avizit earned 125 total points
ID: 11864229
#!/usr/bin/sh

echo "$# parameters were entered"

0
 

Author Comment

by:seremaz
ID: 11864236
i already figured this out, but as you answered me right ill give u the points anyway :p
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now