507 reputation
521
bio website
location
age
visits member for 2 years, 3 months
seen 18 hours ago

Shyy erny anzr - Naqernf Rvonpu


Dec
15
comment bash: What is the difference between these two script variants?
Yes, that's what I was just trying to point out. In JS, the choice of quotes (single/double) does not change the meaning. But in bash, it will, with usually entirely different results in resolving variables (getting literal $var output instead of their value) etc...
Dec
15
comment bash: What is the difference between these two script variants?
Thanks for "abusing" (?) this answer! As said in my comments, it was a long-time false interpretation of yours truly of this quoting stuff. Well, of course I knew that in JavaScript (simple) nested quoting is achieved by using single quotes for the outer and double ones for the inner term. BUT I knew as well that with echo the use of single/double quotes had a totally different meaning (i. e. interpreting $... variables and other things (y/n)). So I assumed the bash way (e. g. echo) is to use double quotes twice. However, had I had a notion of how this is interpreted...oh well.
Dec
14
revised find -exec in bash script with variable expansion
This is (unlike in many other cases) fully POSIX-compliant code, using absolutely no GNU bells or whistles. That's why I thought that the posix tag will be applicable here.
Dec
14
comment Reading and searching long man pages
@Gilles My fingers are really itching to simplify this, especially the pipe which looks like trying to do things completely butt-backwards (to use a US phrase) :)) Like getting the buzz saw from the basement just to cut a 1"-diameter round timber ;))
Dec
14
comment Reading and searching long man pages
I'm not putting this as an answer either ;) because it's indeed about bash itself: just like you, I too mostly need the SHELL BUILTINS part of the manual, which is at about line 3500. So knowing this, the next time I would just say man bash and then go down 66 percent, by typing 66%, then a few times PgDn and I'm there. Though I chose 66 because it can be memorized as "Route 66", it is actually a little more than that, albeit not so easy to memorize unless it is the beginning of your phone #, etc. :) At least the "Route 66" is universal and known worldwide.
Dec
14
comment find -exec in bash script with variable expansion
@user unknown Well, I do LOVE this code. It's at least fully POSIX-compliant and will work without any GNU stuff on the machine at all. There are those times when you do need this, especially on servers at work.
Dec
14
suggested approved edit on find -exec in bash script with variable expansion
Dec
14
comment bash: What is the difference between these two script variants?
@glenn jackman Yes, this is what I've figured out. But it obviously did require me to "study" Hauke's post first to get me bumped head-first onto the truth...Again, I just could not determine what it stood for, whether it was quotes-inside-quotes or, as I know now, an unquoting technique, actively and deliberately excluding the stuff between the quote pairs. It was simply a wrong understanding of things...but the main reason was it always worked, i. e. no complaints from bash's side. And once it works, you commonly don't start asking about any further hows and whys. :)
Dec
14
comment bash: What is the difference between these two script variants?
Aha, and why didn't you tell that in the first place? Sheesh...You're feeling like a true maths guy, I even knew one personally...same thing.---But that aside, thanks for clearing things up once and for all. Still, it IS quoted. Unless someone really proves me wrong, you may nest quotes with echo that way. I begin to understand: you read it as first quote ending before $f and second (empty) quote starting after $f, which leaves the lone $f unquoted. I always thought that the way I wrote them, they're interpreted as nested. Would need a proof though to think otherwise.
Dec
14
comment bash: What is the difference between these two script variants?
@HaukeLaging ??? Now you're getting more and more entangled in the spiderweb of contradictions. You said it's nonsense, clearly, but then you applaud anyone to obey the "good general rule" of quoting everything to be on the safe shore? Please make up your mind, once and for all, before you call something "nonsense." And FFS, express yourself clearly and not so confusing like a philosopher, trying to explain the (highly subjective!!) subtle difference between "nonsense" and "unnecessary". WTH! What's next? The HL theorem about the difference between "rubbish" and "crap"?
Dec
14
comment bash: What is the difference between these two script variants?
I think it's a habit of mine, because I frequently found I "lost" parts of filenames due to whitespace in the past (i. e. found after a short debug run of the script)
Dec
14
comment bash: What is the difference between these two script variants?
Oh thanks! (In fact you've already given the answer.) Most likely I will come across those only once in a blue moon (if at all), but who knows...At least I know I was right calling them "borderline cases", for in normal standard use, none of both would be causing (virtually) any problems...
Dec
14
answered Is there a difference between ./script and bash script?
Dec
14
asked bash: What is the difference between these two script variants?
Dec
14
comment Determining number of files in a directory without counting them
@RedGrittyBrick Be glad you are allowed to install GNU ls! I could name a lot of administrators who do have a root account but who would never install a tool version "from outside"! The actual reason for this is because they are using one of the enterprise server distributions (e. g. RHEL) and they'd invalidate their warranty if they installed a "third-party" tool version (which the warranty would no longer apply to, obviously). And you had better obey to these rules if you run your own business and heavily depend on this stuff to run flawlessly (since it's your means of existence...)
Dec
12
comment How to prevent `mv` from moving a collection of files into a single regular one?
@ayekat Oh well, is this so difficult to get? Because in batch mode, mv is executed n times! And if you execute mv -i also n times, you will also have to confirm mv -i n times for n files (as -i requires user confirmation). And I don't know about you, but with 250 files I would not want to confirm with y (=yes) 250 times.
Dec
12
comment How to prevent `mv` from moving a collection of files into a single regular one?
@ayekat I can see that we're talking past each other. I was saying that I need batch mode, no matter what, and you came up with your great mv -i "solution" entirely unuseable for batch mode (Reason: see above). Moreover, clinging on "additionally" makes not much sense either, because if my line is about a batch-mode solution, I want no "additionally" for a non-batch-mode solution. So I will hold up to my opinion/conclusion that you've simply missed the point. When I go to the butcher's, and order pork, I don't want the butcher to tell me about beef as well and how great it is.
Dec
12
accepted How to prevent `mv` from moving a collection of files into a single regular one?
Dec
12
comment How to prevent `mv` from moving a collection of files into a single regular one?
@ayekat Well, to be frank, I really don't understand how this answer got so many upvotes. I mean, what is the actual point of using mv -i in batch mode?! Clicking "y" 500 times? Who'd be as crazy as that wanting to confirm any single file copied in batch mode? And the line I had in my OP, find...-exec mv ..., IS a batch mode, since mv will be executed n times. In a school exam, I would have gotten a "missing the point" notation for that.
Dec
12
comment How to prevent `mv` from moving a collection of files into a single regular one?
@AndyzSmith Well, that's the very thing. You may call it a habit of mine to only ever use TAB for complicated directories or paths, but not for 2-letter-type ones.:) But come to think of it...perhaps I should really consider the latter case as well from now on.