help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: quote interpretation via vars without eval


From: Alex fxmbsw7 Ratchev
Subject: Re: quote interpretation via vars without eval
Date: Mon, 15 Mar 2021 19:33:07 +0100

we got too many major misunderstandings about 'styles' and learnt by
computers im sure and not sure
i read many wrong misleadings, so i suggest we switch or detail topic

cd /tmp ; >$'\1' ; find $'\1'
./?

very not useable i didnt know i thought it splits by newlines as irc
propagates seems me not all IFS=$'\n' may work or so ..

ls displays it as
''$'\001'

bug with '' in front of it, ls's fault.. i thought i fixed that but it
seems me not yet ( in my prompt script .. )

btw about my english i learnt it off a few places, but i guess i wouldnt
understand former england english by snobs :)

about source and eval, i didnt think much of source cause it causes seemful
more overheat by using redirections, and a printf for code
but i meant more of quote interpreting on other builtins like you listed,
typeset, local, ..
maybe the list is just complete with them ..

On Mon, Mar 15, 2021 at 7:05 PM Koichi Murase <myoga.murase@gmail.com>
wrote:

> 2021年3月15日(月) 7:26 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>:
> > i learnt much by computer chat, more realtime multiline (later now irc
> oneline) - i learned english on computers ( mac os pre x ) i mean it made
> sense, more sense than super epyc processors nowdays with crappy software
> .. :/
>
> So, you learned the ``spoken'' language in text chat on computers and
> don't have much experience in writing English in a more common style?
>
> > about find, it does, actually i didnt benchmark but its mainly two
> reasons, one is find may be slower ( 2x instead of 1x )
>
> We should keep in mind that processing large data with Bash script is
> slow. Usually, it's even slower than the fork & exec cost when the
> number of processed data becomes tens or hundreds. Maybe you can use
> `find' by default and switch to Bash implementation only when the
> number of files is small.
>
> But if you are going to use ls & awk, I don't know which one would be
> faster. Anyway, using `find' is more robust than implementing
> something in Bash or AWK by yourself. I see many failing corner cases
> in your codes.
>
> > and actually it prints filenames malformed with ? question marks instead
> of exact meaning
>
> Can you describe in more detail in what situation such question marks
> are produced? I don't think `find' will generate question marks that
> aren't in the original filenames.
>
> > i guess it may be only declare i can use it i dunno where else it could
> be useful excepts for commands where sadly eval must be used
>
> Hmm... did you wanted to ask about the ways to initialize arrays when
> you have a string of the form `array_name=(value-list)`? If so, you
> may also use `source' other than `declare' family (declare, typeset,
> local, etc.) and `eval'. For example,
>
>   $ source /dev/stdin <<< "$string"  # if your system has /dev/stdin
>
> or
>
>   $ source <(echo "$string")  # With Bash 4.0+
>
> --
> Koichi
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]