tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
1
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-1.sh
Normal file
1
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-1.sh
Normal file
|
|
@ -0,0 +1 @@
|
|||
printf "ha"%.0s {1..5}
|
||||
2
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-2.sh
Normal file
2
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-2.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
i=5
|
||||
printf "ha"%.0s {1..$i}
|
||||
2
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-3.sh
Normal file
2
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-3.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
i=5
|
||||
eval "printf 'ha'%.0s {1..$i}"
|
||||
5
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-4.sh
Normal file
5
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-4.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
reprint() {
|
||||
typeset e="$(sed -e 's,%,%%,g' -e 's,\\,\\\\,g' <<<"$1")"
|
||||
eval 'printf "$e"%.0s '"{1..$2}"
|
||||
}
|
||||
reprint '% ha \' 5
|
||||
2
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-5.sh
Normal file
2
Task/Repeat-a-string/UNIX-Shell/repeat-a-string-5.sh
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
width=72; char='='
|
||||
head -c ${width} < /dev/zero | tr '\0' "$char"
|
||||
Loading…
Add table
Add a link
Reference in a new issue