shell script questionhi,
i have a shell script called abc.sh
i need to use its file name (abc) as the parameter of this script (abc.sh)
is there any way other than hardcode it?
thanks for help.[o_o (6-19 10:27, Long long ago)]
[ 传统版 |
sForum ][登录后回复]1楼
$1, $2, $3.....I did this in bash
what shell r u using?[icky (6-19 21:16, Long long ago)]
[ 传统版 |
sForum ][登录后回复]2楼
用$0echo $0 看看.显示的是不是abc.sh,如果不要.sh,那再用sed命令裁剪掉.不知道是不是你想问的.[egghead (6-20 10:44, Long long ago)] [ 传统版 | sForum ][登录后回复]3楼
(引用 icky:$1, $2, $3.....I did this in bash what shell r u using?)楼上说的是对的,我看错了用bash的string manipulation, 大概是用%还是#,一个是去头,一个是去尾[icky (6-20 11:32, Long long ago)] [ 传统版 | sForum ][登录后回复]4楼
(引用 egghead:用$0echo $0 看看.显示的是不是abc.sh,如果不要.sh,那再用sed命令裁剪掉.不知道是不是你想问的.)thanks guys.[o_o (6-20 23:00, Long long ago)] [ 传统版 | sForum ][登录后回复]5楼