filterTxtforfunc() {
echo does something
}
input_file="input.txt"
while IFS= read -r line; do
# Extract the first 8 characters from the line
code="${line:0:8}"
# Dynamically build the command and execute it
filterTxtforfunc "$0" "$code"
done < "$input_file"
我用过但不起作用的是:
BEGIN {
input_file="input.txt"
while ( (input_file | getline line) > 0 ) {
ARGV[ARGC++] = line
}
close(input_file)
}