LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 644|回复: 0

how do I execute a program which take 1 or more arguments in a shell script??

[复制链接]
发表于 2005-9-20 10:07:26 | 显示全部楼层 |阅读模式
I have a problem that I need to execute a program in my shell and pass some arguments to the program..
I have written a simple shell as follows:

#!/bin/bash

HALLPATH=/home/yzhang/

$($HALLPATH/hall_picker)

hall_picker is the program I need to execute, and this program needs at least one argument to run.
so, how do I write my shell script to pass the argument to the program when the shell script is execute in following format :

nameofthescript argument1 argement2 argement3

I tried this
$($HALLPATH/hall_picker $1 $2 $3) in the script, but it does not work....
what is the right way to do it??? please help....
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表