由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 请教一个shell script的问题
相关主题
Help on shell scriptreplace a string in all files under a directory?
简单问题,可我不会。:( 急用啊!How to find a file in the deep children directory?
向高人请教:怎么从大量的文件中grepRe: 如何用grep查找子目录下的文件?--stop!
[转载] any fast way to learn Yak? (bison and flex)Re: 如何用grep查找子目录下的文件?
如何把一个目录下的文件名全部改成小写?sed? awk? or mak a program?
[转载] How to list the files with specific permission?how to grep a string in all sub-dirs?
shell programming problemshow to escape both ' and " from tcsh?
How do i get a list of all computers?where is the pre-build version of cxterm-solaris
相关话题的讨论汇总
话题: script话题: shell话题: ff话题: recon话题: 字符串
进入Unix版参与讨论
1 (共1页)
n*****n
发帖数: 97
1
请教unix大牛,怎么把字符串parse给script
一个简单的查文件的script叫ff,在所有$1里面匹配$2表示的字符
find . \( -name "$1" -exec grep $2 {} \; -print \)
结果用的时候必须这样 > ff "*.h" recon
怎么改一下可以在用的时候把"*.h"的引号省掉?太别扭了。多谢
o***z
发帖数: 133
2
If you don't disable file name substitution of your shell,
it will interpolate your input of "*.h".
under ksh with -f flag,
ff *.h recon
should work

【在 n*****n 的大作中提到】
: 请教unix大牛,怎么把字符串parse给script
: 一个简单的查文件的script叫ff,在所有$1里面匹配$2表示的字符
: find . \( -name "$1" -exec grep $2 {} \; -print \)
: 结果用的时候必须这样 > ff "*.h" recon
: 怎么改一下可以在用的时候把"*.h"的引号省掉?太别扭了。多谢

n*****n
发帖数: 97
3
好像是bsh -exf 不加引号不工作,看来不把它当字符串对待

【在 o***z 的大作中提到】
: If you don't disable file name substitution of your shell,
: it will interpolate your input of "*.h".
: under ksh with -f flag,
: ff *.h recon
: should work

1 (共1页)
进入Unix版参与讨论
相关主题
where is the pre-build version of cxterm-solaris如何把一个目录下的文件名全部改成小写?
Where's emacs' private dictionary?[转载] How to list the files with specific permission?
UNIX Tip: the bad and the goodshell programming problems
如何删除一组文件或给一组文件更名? How do i get a list of all computers?
Help on shell scriptreplace a string in all files under a directory?
简单问题,可我不会。:( 急用啊!How to find a file in the deep children directory?
向高人请教:怎么从大量的文件中grepRe: 如何用grep查找子目录下的文件?--stop!
[转载] any fast way to learn Yak? (bison and flex)Re: 如何用grep查找子目录下的文件?
相关话题的讨论汇总
话题: script话题: shell话题: ff话题: recon话题: 字符串