Get the App
SLTechnology News&Howtos  ›  Servers  › 

Script implements pv command

Shulou Source: shulou.com Published: 2022-06-02 02:07:58 11月17日 Update

#! / bin/bash

For i in $* # script passes parameters

Do

Echo-n $I

The sequence of for j in `seq 4` # needs to be quoted in reverse quotation marks to achieve the effect.

Do

Sleep 0.3

The nei content after echo-n "." # echo needs quotation marks to avoid abnormal results.

Done

Done

Echo

[root@zhouyaxiong scripts] # sh pv.sh i love you

I....love....you....

[root@zhouyaxiong scripts] # time sh pv.sh i love you

I....love....you....

Real0m3.661s each word will be displayed at an interval of 1.2 seconds.

User0m0.005s

Sys0m0.016s

Tags: Quotation marks scripts content words sequences effects results commands Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Apple Shulou Tech Info Shulou Technology Shulou Information