初识shell编程

shell脚本在Linux中的重要用途 Makefile对工程完成自动化编译

什么是shell呢?shell是用户和内核交互的接口

一个简单的shell程序:

chmod u+x ./shelldemo 添加可执行权限

如果执行shelldemo 无法正常运行该shell脚本、而执行./shelldemo 却可以 why?因为执行shelldemo会去找环境变量 而          在环境变量下、无法找到shelldemo 故无法执行 解决办法 将当前shelldemo的路径添加到环境变量PATH中!

vim /etc/profile 将当前变量添加到PATH中  source  /etc/profile 直接执行shelldemo也可以运行结果!

各种操作系统的shell

UNIX下有Bourne shell(/bin/sh)、C shell(/bin/csh)、Korn shell(/bin/ksh)                                                                                                              Bourne again shell(/bin/bash)、Tenex(tcsh)。

在ubuntu环境下  /bin/sh -> /dash 在ubuntu中/bin/bash 有时候需要创建符号链接指向bash


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值