I have a simple bash script that reads lines from a text file like so:
#!/bin/bash
FILE=$1
while read line; do
done < $FILE
I would like to match text between the string "-type " and a space, so in my line I have:
random text -type 53 random text
I just want to extract "53" and assign it to the variable type_number. Which of these tools cut, sed, grep or awk would be appropriate for such task?