Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
15
Task/Comma-quibbling/UNIX-Shell/comma-quibbling.sh
Normal file
15
Task/Comma-quibbling/UNIX-Shell/comma-quibbling.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
quibble() {
|
||||
# Here awk(1) is easier than sed(1).
|
||||
awk 'BEGIN {
|
||||
for (i = 1; i < ARGC - 2; i++) s = s ARGV[i] ", "
|
||||
i = ARGC - 2; if (i > 0) s = s ARGV[i] " and "
|
||||
i = ARGC - 1; if (i > 0) s = s ARGV[i]
|
||||
printf "{%s}\n", s
|
||||
exit 0
|
||||
}' "$@"
|
||||
}
|
||||
|
||||
quibble
|
||||
quibble ABC
|
||||
quibble ABC DEF
|
||||
quibble ABC DEF G H
|
||||
Loading…
Add table
Add a link
Reference in a new issue