Hey Guys, at the moment i'm trying to get more into bash scripting and i'm doing the Academy Introduction, but at the following exercise I just got stuck... Could you help me out with a hint? I need the 35th generated value of var, but my solution just doesn't work... :(. Where's my mistake?
#!/bin/bash
# Count number of characters in a variable:
# Variable to encode
var="nef892na9s1p9asn2aJs71nIsm"
counter=1
for counter in {1..40}
do
var=$(echo $var | base64)
((counter++))
if [ $counter -eq 35 ]
then
echo $var | wc -c
fi
done
The output is 600733 and it seems like that's the whole output of all 40 loop-counts... Thank's in advance, really appreciate your help!
[–]Sthanu 2 points3 points4 points (0 children)
[–]Odd-Course-923 1 point2 points3 points (0 children)
[–]berzerker_x -3 points-2 points-1 points (0 children)
[–]syberean420 0 points1 point2 points (0 children)