zoukankan      html  css  js  c++  java
  • 【shell脚本学习-2】

    #!/bin/bash - #echo do you have exetuate this project printf "please input your passwd" stty -echo read pass < /dev/tty printf "please agein input your passwd" read pass2 < /dev/tty stty echo #tr -s > 1.txt | sort > 2.txt #echo "1 6 8 1 4 9" > 1.txt | sort 1.txt | tail 1.txt #cat /dev/null #!/bin/bash #cat /bin/liupeng | grep a | wc #$1 #read $x #echo $x #set -x #跟踪 #echo firset echo #set +x #取消跟踪 #echo second echo #locale -a | grep "^L" #环境变量 #LC_ALL=da locale ck LC_TIME ######------------------------------grep+正则表达式-----------------------------# #who | grep -F u1 #判断登录用户 #cat 1.txt | grep ^a | grep b$ #cat 1.txt | grep Aa.Aa #[Aa]d #含有Aa的字符 #cat 1.txt | grep ^Aa #以Aa开头的字符 #cat 1.txt | grep Aa$ #以Aa结尾的字符 #cat 1.txt | grep [[:digit:]] | grep ^2 #匹配含有数字的行列 #cat 1.txt | grep [[:alnum:]] #cat 1.txt | grep digit #cat 1.txt | grep ab*c #匹配含有一个a额字符 #cat 1.txt | grep [[:upper:]]{3}$ #匹配后三位为大写的字符 #cat 1.txt | grep ab?c #匹配ab和abc #cat 1.txt | grep ab+c #----------------------------------sed+正则表达式_______________________________ #sed 's/:.*//' /root/1.txt #find /root -type d -print #mkdir -p /home/1 #sed 's;/home/1;/home/2;' # cat /root/1.txt | sed 's/a/B/g' #替换字符 #n #printf "hello world" #sed -n '/c/p' *.txt #sed -n '$p' "$1" #sed -n '2,5p' /root/1.txt #匹配打印的行数 echo "hello world" | sed 's/world/shell/' #替换指定的字符
    要保持着对知识的渴求,给自己充电,不要这荒废了短暂的时光;
  • 相关阅读:
    c# 简单的通用基础字典
    c#中设置像数量,价格,金额等的textbox的限制条件,用户只能输入数字或小数
    Introduction to Project Management(I)
    MoSCoW Method
    A Guide to Creating a Quality Project Schedule
    Estimating Project Costs
    SMART Goals
    10 Ways to Inspire Your Team
    ExtractTablesFromSQL
    iOS-传感器及使用
  • 原文地址:https://www.cnblogs.com/activecode/p/9526393.html
Copyright © 2011-2022 走看看