i know those two questions have been covered many time but i can't figure how to mix the two command in one:
get string between quote
sed 's/[^"]*"\([^"]*\)".*/\1/' "$file"
get line 2 from file
sed '2q;d' "$file"
many thanks for help.
EDIT:
input files are as follow:
#!/bin/bash
# "/path/to/folder/with/file.ext"
some others lines with quoted string
output
/path/to/folder/with/file.ext
Awk would be my preferred solution here.
awk -F'"' 'NR==2{print $2}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With