bash的执行方式[阮胜昌]
2012-12-27 17:00
92 查看
#!/bin/bash //总是以这个开头
脚本的运行方式:1. 将脚本作为sh的命令行叁数 2.将脚本作为具有执行权限的可执行文件
1.[root@rscpass bash]# sh 1.sh
this is the first bash
[root@rscpass bash]# ls -al
total 32
drwxr-xr-x 2 root root 4096 Oct 6 10:18 .
drwxrwxrwx 23 root root 4096 Oct 6 10:18 ..
-rw-r--r-- 1 root root 42 Oct 6 10:18 1.sh //没有执行权限
-rw------- 1 root root 4096 Oct 6 10:18 .1.sh.swp
2.通过可执行权限来执行BASH
chmod a+x 1.sh
./1.sh // ./表示当前目录
脚本的运行方式:1. 将脚本作为sh的命令行叁数 2.将脚本作为具有执行权限的可执行文件
1.[root@rscpass bash]# sh 1.sh
this is the first bash
[root@rscpass bash]# ls -al
total 32
drwxr-xr-x 2 root root 4096 Oct 6 10:18 .
drwxrwxrwx 23 root root 4096 Oct 6 10:18 ..
-rw-r--r-- 1 root root 42 Oct 6 10:18 1.sh //没有执行权限
-rw------- 1 root root 4096 Oct 6 10:18 .1.sh.swp
2.通过可执行权限来执行BASH
chmod a+x 1.sh
./1.sh // ./表示当前目录
相关文章推荐
- Bash脚本的两种执行方式
- 设置某个shell文件,以bash方式执行
- 五种bash shell执行方式 fork, source, exec, (), {}
- Linux shell脚本执行方式:source、sh、bash、./执行脚本的区别
- bash shell执行方式
- Linux系统下通过bash配置文件的方式将用户执行的命令写入syslog
- bash shell执行、排错、启动配置文件
- SQL Server 执行连接的方式 - Merge Join
- 执行脚本出现bin/bash: bad interpreter: No such file or directory
- Linux基础:Linux(BASH)命令执行和搜索机制
- 带参数的多线程的方式,并且线程按顺序执行
- Linux-002-执行命令时,提示: -bash: {命令}: command not found
- 【BASH】顺序执行一系列的命令
- iOS 延时执行某个方法的几种方式
- fixed_date , 赋权技巧 ,procedure执行方式, PL/SQL注意的地方
- 对比分析iOS延迟执行的4种方式
- C#调用PowShell执行命令的两种方式
- IIS6 启用 gzip 压缩功能,脚本执行方式来设置
- python:通过python脚本快速执行 bash 命令
- linux系统中shell中执行命令是报:bash: ifconfig: command not found错误的解决办法