QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 744|回复: 1

sh -c可不可以这样用?

[复制链接]
发表于 2004-10-6 22:29:38 | 显示全部楼层 |阅读模式
有一个perl文件,正常运行需要两个参数。
在Console下直接运行sh -c ./free_align.pl aattagcaatagcat ccagttatc(free_align.l是那个perl文件,aattagcaatagcat ccagttatc两个字符串是参数)好像参数没有起作用。
但在Console下直接./free_align.pl aattagcaatagcat ccagttatc或者perl ./free_alignpl aattagcaatagcat ccagttatc都是可以的。
请教一下,是不是不应该这么用?
发表于 2004-10-7 16:26:21 | 显示全部楼层
可以看看bash 的man文档
[code:1]
-c string
                 If the -c option is present,  then  commands  are  read  from
                 string.   If  there  are arguments after the string, they are
                 assigned to the positional parameters, starting with $0.

-c string
如果有 -c 选项,那么命令将从 string 中读取。如果 string 后面有参数 (argument),它们将用于给位置参数 (positional parameter,以 $0 起始) 赋值。
[/code:1]
中文manpage(CMPP)可以在这里查看和下载:
http://cmpp.linuxforum.net
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-9-19 19:28 , Processed in 0.055519 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

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