Why do you need
Code: Select all
$value -lt 1 but for an assignment operation and read you only use
Code: Select all
value=1 Code: Select all
read valueIs the '$' symbol only used in comparison? Cant seem to find the answer i need in google
Code: Select all
$value -lt 1 Code: Select all
value=1 Code: Select all
read valueBecause bash is insane, ask anybody.HarryL44 wrote:Why do you needbut for an assignment operation and read you only useCode: Select all
$value -lt 1Code: Select all
value=1
Code: Select all
wally="jimmy bobby freddy jerry"
for x in $wally; do
echo "$x"
done
First of all, when you write it like that, it makes it sound like you are singling out bash in particular. But actually, most of bash is inherited from the general class of "Bourne-ish shells" - so it doesn't make sense to imply that bash is any more or less sane than the rest of the shells in that class. And, in fact, that class of shells is more sane than most (all?) of the others. Sorta like what Churchill said about 'democracy'.Because bash is insane, ask anybody.
Code: Select all
dmesg | grep networkCode: Select all
ls | sort > sorted.lst$ is a way to reference the contents. Without it you are referencing the variable.Is the '$' symbol only used in comparison? Cant seem to find the answer i need in google
Code: Select all
$value -lt 1 Code: Select all
value=1 Code: Select all
read valueThe newest in the saga, The Bourne Shell starring Matt Daemon (cause he runs in the background)Martin Frezman wrote:But actually, most of bash is inherited from the general class of "Bourne-ish shells"
Yes, and the Bourne shell was around when Windows/DOS users were stuck with command.com and cmd.exe - which are appalling.Martin Frezman wrote:First of all, when you write it like that, it makes it sound like you are singling out bash in particular. But actually, most of bash is inherited from the general class of "Bourne-ish shells" - so it doesn't make sense to imply that bash is any more or less sane than the rest of the shells in that class. And, in fact, that class of shells is more sane than most (all?) of the others.Because bash is insane, ask anybody.
Windows/DOS users are *still* stuck with CMD.EXE (COMMAND.COM is long gone).Yes, and the Bourne shell was around when Windows/DOS users were stuck with command.com and cmd.exe - which are appalling.
Code: Select all
man testman test wrote: INTEGER1 -lt INTEGER2
INTEGER1 is less than INTEGER2
https://learnxinyminutes.com/docs/bash/wiki/Test_(Unix) wrote:The test command in Unix evaluates the expression parameter. In most recent shell implementations, it is a shell builtin, even though the external version still exists. In the second form of the command, the [ ] (brackets) must be surrounded by blank spaces. This is because [ is a program and POSIX compatible shells require a space between the program name and its arguments.