Search Results

Search: Posts Made By: psysc0rpi0n
56,980
Posted By Chubler_XL
&& and || control operators examine the exit...
&& and || control operators examine the exit status last command executed in the list.

If the last command has a zero exit status then a command following && will run:
$ [ 1 -eq 0 ]
$ echo $?...
56,980
Posted By stomp
Hello psy, as you saw in the last post from...
Hello psy,

as you saw in the last post from Chubler and me, that we have different views on what is the preferred choice of coding. I hope this causes not too much confusion for you.

Global And...
56,980
Posted By Chubler_XL
Fortunately this stuff is pretty well documented....
Fortunately this stuff is pretty well documented. I'd start with Shell Expansions (https://www.gnu.org/software/bash/manual/html_node/Shell-Expansions.html), it's probably best while reading this to...
56,980
Posted By Chubler_XL
The reason for this is that quote removal only...
The reason for this is that quote removal only occurs on the original input words, not the result of expansions. To demonstrate:

$ echo "Hello, world"
Hello, world
$ VAR='echo "Hello, world"'...
56,980
Posted By Chubler_XL
With some more mucking around, I now have a...
With some more mucking around, I now have a version without eval that also escapes the reserved JSON characters:

#!/bin/bash
mk_json_object(){
local items rest

printf -v items ' "%s":...
56,980
Posted By Chubler_XL
Had a go at simplifying Stomps two functions...
Had a go at simplifying Stomps two functions above. My goal was to get rid of eval, which I achieved for mk_json_object but couldn't achieve this for mk_json_object_one_val:

mk_json_object(){
...
56,980
Posted By stomp
My code is tested and works. But don't rely on...
My code is tested and works. But don't rely on that. Think/Learn how to know and test if the code is working correctly.

The error is that the call of your program is somehow wrong or not like the...
56,980
Posted By stomp
Correct Usage of quoting ;-)
Hello Psy,


Please don't full quote forum posts. Please only quote the short passage of text you're relating to. Refrain from full quoting because it adds redundant information and makes the...
56,980
Posted By stomp
@psysc0rpi0n...
@psysc0rpi0n (https://www.unix.com/member_modal.php?u=302183235&modal=1) Great! You did it! Your code is good.

One of my goal in programming is trying to create code which is readable well. So I...
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 05:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy