💻 Software
awk + print all line content except $1
Fresh5 days ago
Mar 15, 202617066 viewsConfidence Score0%
0%
Problem
I write the follwoing awk script: how to tell awk that I want to print all line except $1 (/var/sysconfig/network/my_functions PATH ) so I will get the following: instead of remark: line content can be anything and not limit by strings/word quantity
Error Output
% echo /var/sysconfig/network/my_functions alpha beta gama | \
awk -v word=alpha '$2 == word { print $0 }'Unverified for your environment
Select your OS to check compatibility.
1 Fix
Canonical Fix
Unverified Fix
New Fix – Awaiting Verification
Fix for: awk + print all line content except $1
Low Risk
If you set to you will leave the delimiting space. If you don't want to do that you have to iterate over the fields: Edit: fixed per Gilles' comment. Another way to do the same thing:
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix