标签归档:shell tips

General Shell Tips

Automatic Command Completion

Use the TAB key and bash will attempt to complete the command for you automatically. You can use it to complete command (tool) names. You can also use it when working with the file-system, when changing directories, copying files et cetera. 继续阅读

shell how tos

shell how to主要收集在shell使用过程中遇到的经典案例,或疑难实现以及shell使用技巧等。

1、 shell如何实现逐行读取文件

#!/bin/sh
filepath="/home/test/test.txt"
while read LINE
do
user=`echo $LINE | awk '{print $1}'`
pwd=`echo $LINE | awk '{print $2}'`
done <$filepath
继续阅读