原帖由 mosoft 于 2007-1-29 16:56 发表
在《linux程序设计》里看到一个程序 first.sh
#!/bin/sh
# first.sh
# This file looks through all the files in the current
# directory for the string POSIX, and then prints those
# files to th ...
原帖由 mosoft 于 2007-1-29 16:56 发表
在《linux程序设计》里看到一个程序 first.sh
#!/bin/sh
# first.sh
# This file looks through all the files in the current
# directory for the string POSIX, and then prints those
# files to th ...
原帖由 mosoft 于 2007-1-29 23:25 发表
但是高手请把程序修改好了,告诉我阿?
我调试了下阿
对于4楼的,直接执行是可以的阿,可是我写了如下代码
#!/bin/sh
# first.sh
# This file looks through all the files in the current
# directory f ...
原帖由 mosoft 于 2007-1-29 23:25 发表
但是高手请把程序修改好了,告诉我阿?
我调试了下阿
对于4楼的,直接执行是可以的阿,可是我写了如下代码
#!/bin/sh
# first.sh
# This file looks through all the files in the current
# directory f ...
原帖由 mosoft 于 2007-1-30 11:15 发表
我改成这样子了
#!/bin/sh
for file in *
do
if grep "^[0-9]\{1,\}" $file
then
echo "FileName is: $file"
more $file
fi
done
exit 0
显示的不符合我的要求阿 ...
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |