21y4d / nmapAutomator

A script that you can run in the background!
MIT License
2.67k stars 790 forks source link

Remove useless use of cat #39

Closed caribpa closed 3 years ago

caribpa commented 3 years ago

As a bird, I am not a cat lover, that's why this commit removes the useless use of cat 😿

caribpa commented 3 years ago

Mmm, that's weird. Even POSIX grep defines that grep shall work with more than one file as parameters.

Anyways, I'll revert the cat removal in these places as it may very well be an issue with different grep implementations.

21y4d commented 3 years ago

yeah perhaps.. it was outputting the IP comma separated, instead of ports comma separated. I'll also have to double check all the outputs to ensure they are the exact same output and with the same character count, as this may make a difference. Though from my initial tests 'and logically thinking' it should work just fine.

caribpa commented 3 years ago

Reverted grep <file1> <file2> to cat <file1> <file2> | grep

21y4d commented 3 years ago

Thanks for updating the commit. I've double tested all changed commands, and all seem to give the exact same output, as expected, and the script works just fine.

Thanks for taking the time to enhance the script :)

caribpa commented 3 years ago

I'm a bit unsure about how could be achieved with nmap (maybe using a cat <file-with-known-output> placeholder can work), but have you consider adding test cases so that you don't have to manually check the output of the commands each time a commit/pull-request is made?

21y4d commented 3 years ago

Yeah definitley have to work on a test script. Thanks