1

Can grep return true/false or are there alternative methods

view story
linux-howto

http://unix.stackexchange.com – I'm trying to write this script for an assignment - it's only the second one I've written so bear with me. As a part of this script, I need to be able to check if the first argument given matches the first word of file. If it does, exit with an error message, if it doesn't, append the arguments to the file. I understand how to write the if statement, but not how to use grep within a script. I understand that grep will look something like this grep ^$1 schemas.txt I feel like this should be much easier than I am making it. Any help appreciated. Update: I'm getting an error too many argume (HowTos)