随笔分类 -  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 阅读全文
posted @ 2024-12-20 15:15 liy36 阅读(21) 评论(0) 推荐(0) 编辑
摘要:``` #!/bin/bash # filename: a.sh # 设置PS4环境变量 export PS4='+ $(basename "$0"):${FUNCNAME}:$LINENO: ' if [ "$debug" == "true" -o "$debug" == "yes" ];then 阅读全文
posted @ 2022-08-12 16:04 liy36 阅读(1861) 评论(0) 推荐(0) 编辑
摘要:#!/usr/bin/env bash # __Author__="liy" # 根据容器内使用的客户端端口查找对应的镜像是哪个,使用此脚本即可查询。 port="$1" function check_env(){ if [ -z "$port" ];then echo -e "\033[31mUs 阅读全文
posted @ 2022-01-04 16:39 liy36 阅读(85) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示