awk使用shell中的变量

来源:互联网 发布:windows createfile 编辑:程序博客网 时间:2024/05/16 00:56

如下, ${os}为awk外部变量:

#!/bin/bashos_types=(windows linux macos)for os in ${types[@]} do    conf_file="${os}.conf"    cat ${conf_file} | awk -F "\t" '{print "'${os}' "$1"    "$3}' done


0 0
原创粉丝点击