Post 9lTkG1s8Jcw3KBafEe by xiroux@kosmos.social
(DIR) More posts by xiroux@kosmos.social
(DIR) Post #9lTkG1s8Jcw3KBafEe by xiroux@kosmos.social
2019-08-02T09:57:56Z
0 likes, 0 repeats
Ok, I need to say it, it is IMPOSSIBLE to remember how to write a loop in bash. Its unfathomable syntax is incomprehensible to the human mind.
(DIR) Post #9lTkG2SI9BrJ8KVXay by fdavidcl@mstdn.io
2019-08-02T10:24:27Z
0 likes, 0 repeats
@xiroux Even better, the 'case ... esac' syntax
(DIR) Post #9lTkG2nYs6sACISWkS by ekaitz_zarraga@mastodon.social
2019-08-02T10:25:05Z
0 likes, 0 repeats
@fdavidcl @xiroux or even better:man [
(DIR) Post #9lTkG3N0kJEFyF2q0G by xiroux@kosmos.social
2019-08-02T10:28:02Z
0 likes, 0 repeats
@ekaitz_zarraga @fdavidcl man [?
(DIR) Post #9lTkG3mtC5vfGV9VL6 by ekaitz_zarraga@mastodon.social
2019-08-02T10:29:03Z
0 likes, 0 repeats
@xiroux @fdavidcl [ is an alias to test.So:if [ $A -gt $B ]is: if test $A -gt $BAAAAAWWW YEAH
(DIR) Post #9lTkG4EXXI2yeG5aRE by felix@radical.town
2019-08-02T13:40:57Z
0 likes, 0 repeats
@ekaitz_zarraga @xiroux @fdavidcl I also have to google bash conditionals every single time. Why do some if statements use [ ... ] and some [[ ... ]] ?
(DIR) Post #9lTkG4elxl1xxcMXKK by clacke@libranet.de
2019-08-02T14:46:03Z
0 likes, 0 repeats
@felix @fdavidcl @ekaitz_zarraga @xiroux [[ is the New And Improved [. [ is there for sh compatibility.
(DIR) Post #9lTy9AWDAWOjTKxY5w by felix@radical.town
2019-08-02T14:47:25Z
0 likes, 0 repeats
@clacke @fdavidcl @ekaitz_zarraga @xiroux So there is no difference in functionality between them when using bash?
(DIR) Post #9lTy9AoI5IrMNPPzH6 by ekaitz_zarraga@mastodon.social
2019-08-02T16:55:14Z
0 likes, 0 repeats
@felix @clacke @fdavidcl @xiroux There is some:
(DIR) Post #9lTy9B611P2PGNi8u0 by clacke@libranet.de
2019-08-02T17:21:35Z
0 likes, 0 repeats
@ekaitz_zarraga @fdavidcl @felix @xiroux Yeah. [ can be, and is in coreutils, implemented as a normal program. [[ is a special syntax with its own quoting rules and everything.Try `asdf='forty two'; [[ 'forty two' = $asdf ]]`, and then `[ 'forty two' = $asdf ]`.
(DIR) Post #9lTyOAZDGrO9xxW4tE by clacke@libranet.de
2019-08-02T17:24:19Z
0 likes, 0 repeats
@fdavidcl @ekaitz_zarraga @felix @xiroux [[ also has regex matching with =~, which [ doesn't.