I'm trying to get every single character of every single line in a given file and then do convertnum()
(Assume that the function works perfectly) on each single character. Here is what I have so far:
#!/bin/bash
file1=$1
while read -r line
do
//I want to iterate over each "line" and then do convertnum "char" on every single character within the line but I don't know how to do it.
done
done < "$file1"
I believe the first answer is not quite right:
Here is the updated script:
#!/usr/bin/env bash
file1=$1
while IFS= read -r line; do
for (( i=0; i<${#line}; i++ )); do
char="${line:$i:1}"
echo $(convertnum "$char")
done
done < "$file1"