デバッグ時に「print」を多く使用し、「#print」としてコメントアウトします。 grepを使用して「印刷」の前に「#」のない行を見つけるにはどうすればよいですか?
# print <- not detect
#print <- not detect
abc # print <-- not detect
print <- detect
ベストアンサー1
grep '^[^#]*print'
print
前には#以外の文字だけが来ることができます。
デバッグ時に「print」を多く使用し、「#print」としてコメントアウトします。 grepを使用して「印刷」の前に「#」のない行を見つけるにはどうすればよいですか?
# print <- not detect
#print <- not detect
abc # print <-- not detect
print <- detect
grep '^[^#]*print'
print
前には#以外の文字だけが来ることができます。