Reputation
Top tag
Next privilege 200 Rep.
See reduced ads
Badges
1 1 9
Newest
 Informed
Impact
~16k people reached

  • 0 posts edited
  • 0 helpful flags
  • 29 votes cast
Mar
5
comment Is there a way to have sh/bash/zsh “case” use a variable for a test value?
With that addition, this strikes me as a workable option (though I'm still going with superuser.com/a/883191/57367 for my particular situation). Thanks!
Mar
3
comment Is there a way to have sh/bash/zsh “case” use a variable for a test value?
The difficulty I have with this is that while $list (as used here, $srsp in the original question) is safe to eval, because it's coded in the script, $var is actually getting data from the command line, and thus could contain things that would break syntax here. It's possible this could be fixed with appropriate quoting? But as you have it, this strikes me as insecure and thus problematic. Still, I do like the idea of making a function out of this, so thank you for that... I might play with this more.
Mar
3
accepted Is there a way to have sh/bash/zsh “case” use a variable for a test value?
Mar
3
comment Is there a way to have sh/bash/zsh “case” use a variable for a test value?
Well, the first option here doesn't really work for me, because it loses the compatibility with egrep (and similar), which was a big part of the point. Your latter suggestion does at least give me a match, though, and that works in this case. (It would in principal be nice to not have to invert the case, but for my purposes, it'll do.) Thanks!
Feb
27
awarded  Informed
Feb
27
asked Is there a way to have sh/bash/zsh “case” use a variable for a test value?
Sep
25
awarded  Famous Question
Oct
21
awarded  Notable Question
Jul
31
awarded  Popular Question
Jun
21
awarded  Revival
Apr
21
awarded  Teacher
Apr
12
awarded  Student
Apr
12
awarded  Scholar
Apr
12
accepted iPhone sync with iTunes stuck on “Waiting for items to copy”
Apr
12
comment iPhone sync with iTunes stuck on “Waiting for items to copy”
Hmm, weird. I just installed the iOS 5.1 update a bit ago, and I'm pretty sure my next sync still failed after this, but maybe that was just because my iPhone had still been plugged in? I just tried again, and it resolved itself. So I guess maybe this did the trick! So, taking this answer to be "If an update is available, install it." Of course, I had been wanting to get a "successful" sync to happen first... that's why I'd waited this long in the first place! Ah well. :)
Apr
12
asked iPhone sync with iTunes stuck on “Waiting for items to copy”
Apr
10
revised Is there a way to access OS X location services from the command line?
added comment about new features.
Apr
10
answered USB Dongle + OSX Location Services/Core Location?
Apr
10
answered Is there a way to access OS X location services from the command line?
Apr
10
comment Is there a way to access OS X location services from the command line?
Nota bene: This is not the same thing. Potentially useful, but not the same thing. In particular, this requires having full internet access, whereas CoreServices I believe can run without that, as long as wifi is enabled. And anyway, even if I'm wrong about that, it uses WIFI-based location finding (and anything else CoreLocation might use, now or in the future), rather than just IP address, which is potentially much more accurate. (See, e.g., here.)