<address id="bjr5b"><form id="bjr5b"></form></address>

    <form id="bjr5b"></form>

        <address id="bjr5b"><listing id="bjr5b"><meter id="bjr5b"></meter></listing></address>

          <form id="bjr5b"></form>
          | ע
          400-650-7353

          Ʒn

          ڵλã > IT؛Y > linux > LinuxA֪RshellַҊ

          LinuxA֪RshellַҊ

          • Դ͘I
          • 2021-09-28 10:42:00
          • x()
          • ֙C

          ַݽȡ

          Ƚ

          ${׃:ʼλ:L}

          lȡַ12345678905λ8λ

          [root@host01 ~]# x="1234567890"

          [root@host01 ~]# echo ${x:4:4}

          5678

          lȡַ12345678903λһλ

          [root@host01 ~]# x="1234567890"

          [root@host01 ~]# echo ${x:2}

          34567890

          [root@host01 ~]# x="1234567890"

          [root@host01 ~]# echo ${#x}

          10

          [root@host01 ~]# echo ${x:2:${#x}}

          34567890

          ȡַ1234567890ǰ5λ

          [root@host01 ~]# x="1234567890"

          [root@host01 ~]# echo ${x:0:5}

          12345

          [root@host01 ~]# echo ${x::5}

          12345

          lȡַ“A񹲺͇”ĵ3λ4λ

          [root@host01 ~]# x="A񹲺͇"

          [root@host01 ~]# echo ${x:2:2}

          ҂Ƚ

          ${׃:0-ʼλ:L}

           ҂Ƚȡַ“A񹲺͇”҂ȵ3λһλ

          [root@host01 ~]# x="A񹲺͇"

          [root@host01 ~]# echo ${x:0-3}

          ͇

          ҂Ƚȡַ“A񹲺͇”҂ȵ3λ_ʼȡ2λ

          [root@host01 ~]# x="A񹲺͇"

          [root@host01 ~]# echo ${x:0-3:2}

          ַ1234567890߅5λ_ʼȡ3λ

          [root@host01 ~]# x="1234567890"

          [root@host01 ~]# echo ${x:5:3}

          678

          ַQ

          1. ֻQһƥY${׃/old/new}

          ַ1234512345Ќһ3Qxxx

          [root@backup ~]# i="1234512345"

          [root@backup ~]# echo ${i/3/xxx}

          12xxx4512345

          2. QȫƥY${׃//old/new}

          ַ1234512345Ќе3Qxxx

          [root@backup ~]# i="1234512345"

          [root@backup ~]# echo ${i//3/xxx}

          12xxx4512xxx45

          ַ1234512345Ќе3Qɿַ

          [root@backup ~]# i="1234512345"

          [root@backup ~]# echo ${i//3/}

          12451245

          ַ݄h

          1. ƥh${׃#*PI~}

          ַhttp://www.sina.com.cnЌð̖“:”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i#*:}

          //www.sina.com.cn

          ַhttp://www.sina.com.cnЌһ“.”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i#*.}

          sina.com.cn

          2. Lƥh${׃##*PI~}

          ַhttp://www.sina.com.cnЌ“http://”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i##*\/}

          www.sina.com.cn

          ַhttp://www.sina.com.cnЌһ“.”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i##*.}

          cn

          ַhttp://www.sina.com.cnЌһ“w”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i##*w}

          .sina.com.cn

          3. ƥh${׃%PI~*}

          ַhttp://www.sina.com.cnЌ߅һ“.”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i%.*}

          http://www.sina.com

          Ӌ㮔ǰűP“/”օ^ĴűPʹ

          [root@backup ~]# df

          Filesystem 1K-blocks Used Available Use% Mounted on

          devtmpfs 487168 0 487168 0% /dev

          tmpfs 497828 0 497828 0% /dev/shm

          tmpfs 497828 7636 490192 2% /run

          tmpfs 497828 0 497828 0% /sys/fs/cgroup

          /dev/sda3 11523072 1674024 9849048 15% /

          /dev/sda1 520868 156640 364228 31% /boot

          tmpfs 99568 0 99568 0% /run/user/0

          t֘R15%ȡxֵo׃i

          [root@backup ~]# df|grep "/$"

          /dev/sda3 11523072 1674100 9848972 15% /

          [root@backup ~]# df|grep "/$"|awk '{print $5}'

          15%

          [root@backup ~]# i=$(df|grep "/$"|awk '{print $5}')

          [root@backup ~]# echo $i

          15%

          ַ“15%”е“%”ȥ

          [root@backup ~]# echo ${i%\%*}

          15

          4. Lƥh${׃%%PI~}

          ַhttp://www.sina.com.cnЌ߅һ“.”߅ַȥ

          [root@backup ~]# i="http://www.sina.com.cn"

          [root@backup ~]# echo ${i%%.*}

          http://www

          ַ׃ʼֵ̎

          ʹecho ${׃:-ֵ}ķʽݔ׃ֵ׃ھݔھݔO“ֵ”

          ׃xӡ׃xֵ;׃xڴӡOֵ

          [root@host01 ~]# x="1234567890"

          [root@host01 ~]# echo ${x:-abc}

          1234567890

          [root@host01 ~]# unset x

          [root@host01 ~]# echo ${x:-abc}

          abc

          Ո
          Ԓ
          n
           

          й͘I

          ITС

          ϷSaӺՈע599W

          >>ĵַ
          עվδSɲDdDdՈ̎Դļַ

          ]x

          ͘Iujiuye

          Pעй͘Iٷ΢

          • Pע΢Ż؏PI~“Y”W
          QQȺ
          ھɆ
          (Ⱥע“Wվ”)
          ITӖȺ Ⱥ +
          ܛyԇ Ⱥ +
          ȫ·UI/UEOӋ Ⱥ +
          Python+˹ Ⱥ +
          “WIN Ⱥ +
          Java_l Ⱥ +
          PHP_l Ⱥ +
          VR/ARΑ_l Ⱥ +
          ǰ Ⱥ +
          󔵓 Ⱥ +
          LinuxӋ Ⱥ +
          ͘Iٷ΢
          ߴa؏PI~“Y”
          W

          yһy
          mόWTITg

          1 g

          2 ČWv

          3 ĂĹ

          @ȡyԇY
           
          nYӃ Iȡͨ
           
           
          国产成人精品亚洲日本语言
          <address id="bjr5b"><form id="bjr5b"></form></address>

            <form id="bjr5b"></form>

                <address id="bjr5b"><listing id="bjr5b"><meter id="bjr5b"></meter></listing></address>

                  <form id="bjr5b"></form>