3

Trying to compare two files line by line to see if a signal has increased by 5 dbm or more in bash is hurting my brain. I probably need to switch from bash for it but so much of the other jobs this script does is fully functional in bash I'd hate to switch now. Any advice please help.

Comments
  • 3
    If it's just a utility script, why not use something like python? Far more flexible, and far less syntax-induced headaches.
    You can even call external cmd programs through the subprocess module, of you need to

    Also, have you considered using something like 'diff', or 'git diff --no-index' (if it's a txt file and the difference is of a certain kind - just throwing it out there)
  • 0
    also you can always use a here-string or something and put a python -c in the bash
  • 0
    @endor its more complicated. Diff would throw out in the worst case both files. He said "increased by 5 dbm or more". So he needs to read a line compare it numericaly and save it. But i would do that in bash too.
  • 0
    This one script does many things. It compares multiple devices lan speed to a base history to see if it changed and check if the device has a signal above a -60. After all that it sends the info out. I got all that stuff done there pretty easily, but the signal increasing by 5 dbm is frustrating.
Add Comment