Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
検索でawk変数を使用するには?
Name="jony" awk -v name="$Name" '/name/ {print $0}' file
これは string を検索しますが、実際にはstring は検索しnameません。$Namejony
name
$Name
jony
私が問題を正しく理解したことを願っています:
awk '/'"$Name"'/ { print } ' testfile