Redian新闻
>
为什么我就是不会写Shell script?
avatar
为什么我就是不会写Shell script?# Unix - 噫吁兮,危乎高哉
o*i
1
这学期选了Unix
把书上的command都看了
可还是觉得shell script就是一团浆糊 一点概念也没有
为什么还是觉得shell script无从下手呢?
比如说从一个目录树下找出所有的子目录里面的可执行文件
我只能想到用find or ls
不知道怎么用error handling 和怎么动手开始写code
??为什么知道unix command 就是不会写code呢??
不知道该怎么办 急死了
大侠们帮帮我 告诉我怎么样才会写code呀
多谢!
avatar
o*i
2
有没有什么书可以学习怎么开始写code的?
用man只能查到command
可我知道command怎么用还是不会写shell script code..:(

【在 o*****i 的大作中提到】
: 这学期选了Unix
: 把书上的command都看了
: 可还是觉得shell script就是一团浆糊 一点概念也没有
: 为什么还是觉得shell script无从下手呢?
: 比如说从一个目录树下找出所有的子目录里面的可执行文件
: 我只能想到用find or ls
: 不知道怎么用error handling 和怎么动手开始写code
: ??为什么知道unix command 就是不会写code呢??
: 不知道该怎么办 急死了
: 大侠们帮帮我 告诉我怎么样才会写code呀

avatar
l*l
3
咳, 以前我老板曾经批评俺说: 别偷懒, 在写shell程序就开掉你.
其实shell程序无非是 几个基本的语法, 比最基本的C还要简单.
我猜想你可能是对众多的指令不熟悉吧, 多看看 sed , awk , expr
会有帮助.

【在 o*****i 的大作中提到】
: 这学期选了Unix
: 把书上的command都看了
: 可还是觉得shell script就是一团浆糊 一点概念也没有
: 为什么还是觉得shell script无从下手呢?
: 比如说从一个目录树下找出所有的子目录里面的可执行文件
: 我只能想到用find or ls
: 不知道怎么用error handling 和怎么动手开始写code
: ??为什么知道unix command 就是不会写code呢??
: 不知道该怎么办 急死了
: 大侠们帮帮我 告诉我怎么样才会写code呀

avatar
o*i
4

不是啊
这些我都熟悉呀
还是不知道如何入手写script codes
对它就是没有概念
why?怎么办呢

【在 l*l 的大作中提到】
: 咳, 以前我老板曾经批评俺说: 别偷懒, 在写shell程序就开掉你.
: 其实shell程序无非是 几个基本的语法, 比最基本的C还要简单.
: 我猜想你可能是对众多的指令不熟悉吧, 多看看 sed , awk , expr
: 会有帮助.

avatar
t*c
5

看看/etc目录下的那些scripts吧, 没事儿再改改, 不就差不多了.

【在 o*****i 的大作中提到】
:
: 不是啊
: 这些我都熟悉呀
: 还是不知道如何入手写script codes
: 对它就是没有概念
: why?怎么办呢

avatar
c*t
6
The reason is that you are not very familar w/ programming :)
The very general strategy is
1. identify the information you will need in the end.
2. identify the commands necessary to gather these information
3. put them all together.

【在 o*****i 的大作中提到】
:
: 不是啊
: 这些我都熟悉呀
: 还是不知道如何入手写script codes
: 对它就是没有概念
: why?怎么办呢

avatar
o*i
7

Yes! i found the problem...
i don't know how to put them together...hehe
what to do?
thanks a lot lot

【在 c*****t 的大作中提到】
: The reason is that you are not very familar w/ programming :)
: The very general strategy is
: 1. identify the information you will need in the end.
: 2. identify the commands necessary to gather these information
: 3. put them all together.

avatar
o*i
8

i checked
but like if i want get a script about "mail"
when i typed "ls -l /etc/mail*"
list some file but seems no script files yah...
how to find the script files?
what to do? thanks a lot!

【在 t**c 的大作中提到】
:
: 看看/etc目录下的那些scripts吧, 没事儿再改改, 不就差不多了.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。