Search Results

Search: Posts Made By: azaiiez
14,994
Posted By RudiC
Extending MadeInGermany's appoach by sym[six]=6...
Extending MadeInGermany's appoach by sym[six]=6 and after running his code in bash 4 as required, try
echo $((out))
1690Or, try
echo $out | bc
1690
14,994
Posted By MadeInGermany
With bash-4 it's a piece of cake: #!/bin/bash ...
With bash-4 it's a piece of cake:
#!/bin/bash
# bash-4 required
declare -A sym
sym=(
[zero]=0
[one]=1
[two]=2
[three]=3
[four]=4
[five]=5
[plus]=+
)

while read -r -a words
do
...
14,994
Posted By wisecracker
Hi azaiie... This sounds easy, but is much...
Hi azaiie...

This sounds easy, but is much more difficult than you think using a fully POSIX compliant shell.
This is fully POSIX compliant and gets 39 individual words into individual variables...
891
Posted By RudiC
Try this slight modification to your attempt: ...
Try this slight modification to your attempt:

for i in file[1-4]
do read -r line
if [ "$i" == "test" ]
then continue
fi
echo $line >> $i
done < test
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 02:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy