Code
sed -n 's/.*tex:/[preventColonFromResult]/p' ./BitTorrentSync/Gyn/1.12.2015.tex: Agents in young <40yr?
where
- input is
./BitTorrentSync/Gyn/1.12.2015.tex: Agents in young <40yr?. - expected output is
./BitTorrentSync/Gyn/1.12.2015.tex.
I think -n does not make sense here because I want to pass the output to less.
I search the match .*tex: but it actually should not include : in the result.
I keep p at end to not do replacement.
DonCristi's output for grep
Trying to split at colon : with grep without the seed of sed/grep/...
Code in GNU Grep 2.23
find . -name "*.tex" -exec ggrep -i -oP '^[^:]*(?=:)' {} \; | less
Unsuccessful output with output as the content of files, not filenames. This command actually includes only content of files, and it leaves outside the filenames.
How can you get everything before colon : in SED/Grep/...?
find . -name "*.tex" -exec grep -i -H "agent" {} \;.findcommand? Please, provide your output. My output in unsuccessful and many lines ofggrep: agent: No such file or directory.