1. 程式人生 > >shell 輸出100個+方法總結

shell 輸出100個+方法總結

shell 輸出100個+方法總結

python -c "print(‘+‘*100)"

head -c 100 /dev/zero |awk ‘gsub(/./,"+")‘

perl -le "print(q(+)x100)"

println("+"*100)

輸出50個=的方法

  1. echo "" | sed ‘:a; s/^/=/; /=\{50\}/b; ta‘

  2. sed ‘:a;s/^.\{0,49\}$/&=/;ta‘ <<<""

  3. awk ‘BEGIN{OFS="=";NF=50;print}‘

  4. awk ‘BEGIN{while(n++<50)printf "=";print""}‘

  5. seq -s‘a‘ 50 | tr -d ‘[0-9]‘

  6. for i in `seq 50`; do echo -n =; done

  7. yes "=" | sed ‘50q‘ | tr -d ‘\n‘

  8. yes "=" | head -n 50 | tr -d "\n"

  9. perl -le ‘print "=" x 50‘

  10. python -c "print ‘=‘*50"

  11. printf "%0050d\n" 0 | tr "0" "="

  12. eval printf ‘%.0s=‘ {1..50}

  13. str=$(printf "%*s" "50"); echo ${str// /=}



本文出自 “Linux Oracle MariaDB” 博客,請務必保留此出處http://wangergui.blog.51cto.com/8504247/1926807

shell 輸出100個+方法總結