742 reputation
110
bio website
location
age
visits member for 1 year, 8 months
seen yesterday

Nov
13
accepted How can I programatically tell if a filename matches a shell glob pattern?
Nov
5
comment I need to create file with name is the result of the command in Solaris
What shell are you using? In most shells, you want to do touch $(ls -l | head -2) or touch `ls -l | head -2`
Nov
5
revised How can I programatically tell if a filename matches a shell glob pattern?
added 38 characters in body
Nov
5
comment How can I programatically tell if a filename matches a shell glob pattern?
The question states that the bash shell will be used.
Nov
5
comment How can I programatically tell if a filename matches a shell glob pattern?
Hi @mikeserv, as indicated in the comments and the answer that I provided above, I have already learned that what you say is true - {bar,baz} is not a glob pattern. I have already come up with a solution to my question that takes this into account.
Nov
4
revised How can I programatically tell if a filename matches a shell glob pattern?
deleted 109 characters in body
Nov
4
comment How can I programatically tell if a filename matches a shell glob pattern?
What I mean is this: your proposed solution works, but it introduces a new problem: how to transpose patterns from one form of expression to another. I have figured out the answer to my question and posted it here as an answer.
Nov
4
answered How can I programatically tell if a filename matches a shell glob pattern?
Nov
4
comment How can I programatically tell if a filename matches a shell glob pattern?
So all you've really done is transformed my question from "how do I tell if a filename is a potential expansion of an expression" to "how do I convert normal bash-style filename patterns to bash-style extended glob patterns."
Nov
4
comment How can I programatically tell if a filename matches a shell glob pattern?
Ok, this works, but strictly speaking, it doesn't answer my question. For instance, I would like to consider patterns that are coming from another source, i.e., the patterns are out of my control.
Nov
4
comment Is there a `--paranoid` type flag for common, potentially irreversible commands?
A common problem with scripting is the need to test the script before it is run. However, because scripts typically have a large number of side effects (e.g., network, filesystem, etc.), it is actually quite difficult to test scripts in an isolated environment and examine the side-effects. I'm not aware of any good solution to this problem.
Nov
4
comment How can I programatically tell if a filename matches a shell glob pattern?
@Patrick: after reading through the bash man page, I have learned that foo/{bar,baz} is actually a brace expansion (not a parameter expansion) while foo/* is pathname expansion. $string is parameter expansion. These are all done at different times and by different mechanisms.
Nov
4
comment How can I programatically tell if a filename matches a shell glob pattern?
If the shell can expand parameters, then surely it can tell if a string is a potential expansion of a glob.
Nov
4
revised How can I programatically tell if a filename matches a shell glob pattern?
added 185 characters in body
Nov
4
asked How can I programatically tell if a filename matches a shell glob pattern?
Nov
4
comment libGLEW.so.1.11: cannot open shared object file
This is not a compile-time problem, but a run-time problem, as @Gilles explained. You compiled the source code properly, now you need to point the run-time linker to the libraries that you linked against.
Nov
4
comment libGLEW.so.1.11: cannot open shared object file
Using RPATH to link against external libraries (like you are doing in this case) may make the compiled binary less portable. I think using the LD_LIBRARY_PATH variable is the better solution in this case.
Oct
13
comment use mosh without giving up local scrollback / history?
though this answer was downvoted for technical reasons, it's probably the best (only?) way to get decent scrollback on the local client using mosh.
Oct
8
comment List all connected SSH sessions?
@m13r, I've moved my comments that address your questions into the body of my answer.
Oct
8
revised List all connected SSH sessions?
moved comments into answer