279 reputation
18
bio website
location Austria
age
visits member for 2 years, 3 months
seen 2 days ago

Jun
17
awarded  Caucus
May
6
comment How to sed -e 's///' everything except a specific pattern?
does each line contain only one % sign?
May
6
comment Detecting extension files doesn't executed for a period
you suggest to use the option "newer" but actually you use "newerat"
Apr
30
revised Remove last comma from a bash for loop generated string
minor changes
Apr
30
answered Remove last comma from a bash for loop generated string
Apr
4
comment What does $# mean in shell?
you can browse the manual
Apr
2
comment A bash function that takes argument like other languages?
@mikeserv: For what value of V the function assign PATH "$V" executes some malicious code?
Apr
2
comment A bash function that takes argument like other languages?
@mikeserv: It is interesting when one wants to use your variable v (better its value) as second argument of the assign function. So its value should be on the right hand side of an assignement. It is necessaary to quote the argument of the function assign. I added this subtlety to my posting.
Apr
2
comment A bash function that takes argument like other languages?
@mikeserv: I think that your proposal to transform the first argument silently to a valid variable name is not a good idea: 1) some variable is set/overwritten that was not intended by the user. 2) the error is hidden from the user of the function. That is never a good idea. One should simply raise an error if that happens.
Apr
2
comment A bash function that takes argument like other languages?
@mikeserv thank you for your comment but I think that is not a valid example. The first argument of the assign script should be a variable name or a variable that contains a variable name that is used on the left hand side of the = assignement statement. You can argue that my scrip does not check its argument. That is true. I do not even check if there is any argument or if the number of arguments is valid. But this was by intention. The OP can add such checks if he wants.
Apr
2
revised A bash function that takes argument like other languages?
and additional sample quere quoting must be considered
Apr
2
revised A bash function that takes argument like other languages?
link to description of eval
Apr
2
revised A bash function that takes argument like other languages?
making the function variables local
Apr
2
revised A bash function that takes argument like other languages?
removed variables in functions
Apr
2
answered A bash function that takes argument like other languages?
Apr
2
comment A bash function that takes argument like other languages?
assign-path /abc will not append /abc to PATH if $PATH already contains /abc/def, /abcd, /def/abc etc. Especially you can't add /bin if PATH already contains /usr/bin.
Jan
28
answered Paths in my bash profile do not work!
Oct
16
comment Get exit status of process that's piped to another
When using the temporary file approach I prefer to add a trap for EXIT that removes all temporary files so that no garbage will be left even if the script dies
Oct
16
comment returncode of command in a pipline
@Joseph R. : I see it is a duplicate now and your link contains the answers
Oct
16
awarded  Scholar