Update Mon Oct 17 11:03:59 AM EDT 2022

This commit is contained in:
Austin Burk
2022-10-17 11:03:59 -04:00
parent 9cb0884471
commit 883a2e7bde
4 changed files with 22 additions and 4 deletions

View File

@ -11,6 +11,24 @@ expandmc () {
s2n () {
tr ' ' '\n'
}
# input: abc
# output: Abc, aBc, abC
function upperall() {
input=$1
echo $input
for (( i=0; i<${#input}; i++ )); do
changed_char=${input:$i:1}
echo ${input:0:$i}${changed_char^^}${input:$i+1}
done
}
# same as above but for each line of piped input
function upperall_piped() {
while read line; do
upperall $line
done
}
```
```sh