摘要: Shell 语言中的if条件 一、if的基本语法: if [ command ];then 符合该条件执行的语句 elif [ command ];then 符合该条件执行的语句 else 符合该条件执行的语句 fi 二、文件/文件夹(目录)判断 [ -b FILE ] 如果 FILE 存在且是一个 阅读全文
posted @ 2020-11-22 22:11 寅鸷 阅读(235) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash file_count=0 folder_count=0 function TRAVEL_ALL_FILE(){ for file in *; do if [ -f ${file} ];then #normal file echo ${file} ((file_count++) 阅读全文
posted @ 2020-11-22 22:09 寅鸷 阅读(1397) 评论(0) 推荐(0) 编辑
摘要: 本文出自 https://www.cnblogs.com/chengmo/archive/2010/10/02/1841355.html 转载用于学习参考,方便查阅,尊重原创 ! 在做shell批处理程序时候,经常会涉及到字符串相关操作。有很多命令语句,如:awk,sed都可以做字符串各种操作。 其 阅读全文
posted @ 2020-11-22 21:58 寅鸷 阅读(137) 评论(0) 推荐(0) 编辑