LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Old

["SOLVED"] Weird failure in bash string comparison

Posted 05-02-2016 at 01:43 AM by the dsc (linux-related notes)
Updated 05-02-2016 at 01:52 AM by the dsc

A string produced by a given command is somehow different from a string produced by "catting" a file produced by redirecting the output of the very same command. That's weird, if you ask me.

The "solution" is not to compare them both, but create a second file from the "same" redirection, and then strings from "catting" those files. Then the comparison won't always say the strings are different.

Code:
#!/bin/bash
apps=$(ps -axo
...
Member
Posted in Uncategorized
Views 477 Comments 0 the dsc is offline

  



All times are GMT -5. The time now is 02:37 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration