随笔分类 - shell脚本
shell脚本的学习笔记,有空就写,没空不写
摘要:#!/usr/bin/env bash # Author=liy36 export PS4='\[\e[35m\]+ $(basename $0):${FUNCNAME}:$LINENO: \[\e[0m\]' if [ "$(id -u)" -ne 0 ];then echo "Switch to
阅读全文
摘要:``` #!/bin/bash # filename: a.sh # 设置PS4环境变量 export PS4='+ $(basename "$0"):${FUNCNAME}:$LINENO: ' if [ "$debug" == "true" -o "$debug" == "yes" ];then
阅读全文
摘要:#!/usr/bin/env bash # __Author__="liy" # 根据容器内使用的客户端端口查找对应的镜像是哪个,使用此脚本即可查询。 port="$1" function check_env(){ if [ -z "$port" ];then echo -e "\033[31mUs
阅读全文