Simple bash script please help!
Hello,
I have the output: brouter mdstat # md5sum -c /root/mdstat.md5 /proc/mdstat: OK I would like to have a script that has IF function in it, so every time the output of that md5sum command will have any other output, to echo a message. I've tried: Quote:
Thanks a lot everyone! |
You really could actually tell us what the error is, that's kinda helpful...
I can see that you're using test wrong though, -ne compares two numbers, whereas you are trying to compare to file*NAMES* not the contents of the files or anything past that. you need to use = to compare strings, as the manpage states, but then you've not put much of this in any context so it's hard to work out what you're really doing. if you want to check a previous md5sum then it's a lot simpler, for example: md5sum -c /a/b/c.md5 > /dev/null if [ $? ] then ... fail ... else ... pass ... fi |
Tried like this:
Quote:
[: /proc/mdstat: OK: integer expression expected |
stupid me, tried with "!=" and it's working, thanks a lot acid_kewpie!
|
All times are GMT -5. The time now is 02:23 AM. |