scripts taking arguments


 
Thread Tools Search this Thread
Special Forums UNIX Desktop Questions & Answers scripts taking arguments
# 1  
Old 07-10-2011
scripts taking arguments

I am trying to write a script using commands to print a sequence of numbers.
However, I can't get jot to recognize what I give it.
Code:
Terri$ cat mncmd
echo "m=$1"
echo "n=$2"
$jot $2
Terri$ ./mncmd 1 10
m=1
n=10
./mncmd: line 3: $2: command not found

I've also tried
Code:
Terri$ cat mncmd
echo "m=$1"
echo "n=$2"
echo $jot $2 $1
Terri$ ./mncmd 1 10
m=1
n=10
10 1

Why isn't this working???
# 2  
Old 07-10-2011
What is this $jot variable?

If it's not a variable, why the $ ?
# 3  
Old 07-10-2011
jot isn't a variable, its the mac equivalent of seq
# 4  
Old 07-10-2011
If it's not a variable, then you don't want a $ in front of it.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk command line arguments not taking

# more minusf.awk #!/bin/awk -f BEGIN { FS=":"; } { if ( $2 == "" ) { print $1 ": no password!"; } } # ./minusf.awk aa aa aa aa awk: can't open aa (6 Replies)
Discussion started by: sri.phani
6 Replies

2. Shell Programming and Scripting

Arguments to scripts

Hi All, i have a requirement, that script should take inputs/arguments from a file. 1. There is already a script which will ask for input for execution of next step, say: date, reason. name etc.... 2. I dont have read or write access to this script just execute permissions. I tried... (5 Replies)
Discussion started by: nanz143
5 Replies

3. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

4. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

5. Shell Programming and Scripting

grep with two arguments to arguments to surch for

Hello, is it possible to give grep two documents to surche for? like grep "test" /home/one.txt AND /home/two.txt ? thanks (1 Reply)
Discussion started by: Cybertron
1 Replies

6. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

7. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

8. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

9. Shell Programming and Scripting

Passing Arguments in Shell Scripts

Hello everybody! First time posting here:) Right, I am trying to pass arguments in my shell scripts using $1, $2 and $3 etc using if else statement........ This is my shell script which is based on serching the google website #!/bin/sh wget -t1 -E -e robots=off - -awGet.log -T 200 -H... (47 Replies)
Discussion started by: kev_1234
47 Replies

10. Shell Programming and Scripting

Passing and using arguments in Scripts.

I am new to scripting in AIX / UNIX. I have a script that runs 4 other scripts and I want to be able to pass in a agrument that I can check before I run the next script to see if the previous script finished with no errors. Can someone send me an example of this as I'm sure it's pretty easy to... (1 Reply)
Discussion started by: David.Vilmain
1 Replies
Login or Register to Ask a Question