Home » Questions » Computers [ Ask a new question ]

Unix: How to check the existence of a tag at the beginning of each file before insertion?

Unix: How to check the existence of a tag at the beginning of each file before insertion?

The question is related to the question "Unix: Add a Tag to the beginning of each file?".

Asked by: Guest | Views: 323
Total answers/comments: 3
Guest [Entry]

head -n1 file | grep -q "^<?php" || sed -i "1s/^/<?php /" file
Guest [Entry]

"You want || (OR). If the left hand is true, it will not bother with the right hand. e.g.

test ""$(grep PATTERN FILE)"" || sed COMMAND FILE"
Lzboyf [Entry]

atorvastatin 10mg brand <a href="https://lipiws.top/">buy lipitor medication</a> lipitor usa