Bash Shell使用技巧
2010-03-02 09:33
585 查看
1. Makefile与Shell取环境变量的不同方法
Makefile: cc=$(CROSS_COMPILE)
Shell: cc=$CROSS_COMPILE
2.从命令中得到值
removable=$(cat /sys/block/$1/removable)
3. while
export TSLIB_TSDEVICE=/dev/ts
counter=1
while [ 1 ] --> 无限循环
while [ $counter -lt 10 ]
do
aplay music.wav &
ts_test &
counter_inner=1
while [ $counter_inner -lt 60 ]
do
sleep 4
counter_inner=$(( $counter_inner + 1 ))
done
pkill ts_test
counter=$(( $counter + 1 ))
echo "the counter is $counter"
done
4. For
for file in $( find . -type f -name "*.bz2" | sort )
do
tar xvfj $file -C /scratch/paul/lite/linux/src/
done
5. 如何过滤bash的错误输出?
arm-none-linux-gnueabi-gcc -v 2>/dev/null
stdin 0<
stdout 1>
stderr 2>
Makefile: cc=$(CROSS_COMPILE)
Shell: cc=$CROSS_COMPILE
2.从命令中得到值
removable=$(cat /sys/block/$1/removable)
3. while
export TSLIB_TSDEVICE=/dev/ts
counter=1
while [ 1 ] --> 无限循环
while [ $counter -lt 10 ]
do
aplay music.wav &
ts_test &
counter_inner=1
while [ $counter_inner -lt 60 ]
do
sleep 4
counter_inner=$(( $counter_inner + 1 ))
done
pkill ts_test
counter=$(( $counter + 1 ))
echo "the counter is $counter"
done
4. For
for file in $( find . -type f -name "*.bz2" | sort )
do
tar xvfj $file -C /scratch/paul/lite/linux/src/
done
5. 如何过滤bash的错误输出?
arm-none-linux-gnueabi-gcc -v 2>/dev/null
stdin 0<
stdout 1>
stderr 2>
相关文章推荐
- bash shell数组模拟队列queue和shell数组使用技巧
- linux bash shell 使用技巧
- Linux/Unix下Shell快捷键操作大集合及部分Bash使用技巧-另附Ubuntu常用快捷键
- Linux使用技巧:linux下将命令值赋给shell变量
- 最牛B 的 Linux Shell 命令, SHell使用技巧
- bash参数使用技巧
- 一些非主流的bash shell命令与技巧
- 使用chsh修改默认的shell为bash,原来为sh不支持TAB等功能
- shell命令使用技巧
- [Linux学习笔记]第1天:操作系统的发展史,linux诞生,Linux发行商,shell,terminal,shell使用技巧,文件目录,基本操作
- linux中查看现在使用的shell是ksh还是bash?以及怎样修改?
- [Linux学习笔记] Linux常用命令 - 番外篇(Shell使用技巧)
- Shell使用技巧
- Shell ${} 变量使用技巧
- bash的使用技巧
- Mac shell使用技巧总结
- 使用FUNCNAME 和BASH_LINENO实现shell脚本中定位函数错误在代码中的位置
- shell使用技巧
- Linux中rsh远程shell命令的使用技巧解析
- shell 数组建立及使用技巧