Why the results of the script does not display the size of the history?

Good evening!
Not displayed with in the script the size of the history.
Somebody can tell why?
Writes that does not find,in the console echo $HISTSIZE finds
#!/bin/bash

echo "Hello$(whoami) ,the size of Your history $(HISTSIZE) teams."
March 19th 20 at 09:28
2 answers
March 19th 20 at 09:30
Solution
$(variable) - is not true
$(command) -- true
${variable} - is true
${command} -- wrong

whoami - command
HISTSIZE variable

p.s
to work in the script, add at the beginning
set-o history
When the script generates an error,but directly in the console works like - bernadette.Haag33 commented on March 19th 20 at 09:33
@bernadette.Haag33the mistake ?
I like all works
#!/bin/bash
set-o history
echo "Hello$(whoami) ,the size of Your history ${HISTSIZE} commands."
- hector.Sipes commented on March 19th 20 at 09:36
@nick3iro,
sc1.sh: 2: set: Illegal option -o history - bernadette.Haag33 commented on March 19th 20 at 09:39
@bernadette.Haag33, as I see it there probably one of two things either when writing accidentally got hidden characters or line feed Windows and not UNIX - hector.Sipes commented on March 19th 20 at 09:42
@bernadette.Haag33, try it before starting just to convert the script with the command dos2unix:
dos2unix FILE - hector.Sipes commented on March 19th 20 at 09:45
@nick3iro, did not help... - bernadette.Haag33 commented on March 19th 20 at 09:48
@bernadette.Haag33, strange, well, then you can still look which are non-printable characters in the script with the command:
cat -vet FILE - hector.Sipes commented on March 19th 20 at 09:51
Given something like

etenenba@ubuntu:~$ cat -vet sc1.sh
#!/bin/bash$
$
echo M-PM-^WM-PM-4M-QM-^@M-PM-0M-PM-2M-QM-^AM-QM-^BM-PM-2M-QM-^CM-PM-9M-QM-^BM-PM-5,$(whoami),M-QM-^@M-PM-0M-PM-7M-PM-M-QM-^@M-PM-8M-PM-8 M-PM-:M-PM->M-PM- - bernadette.Haag33 commented on March 19th 20 at 09:54
@bernadette.Haag33, uh, don't see lines to include history and HISTSIZE variable also did not see
well I kind of wrote the above working example
#!/bin/bash
set-o history
echo "Hello$(whoami) ,the size of Your history ${HISTSIZE} commands."

this specific example you are working or not ? - hector.Sipes commented on March 19th 20 at 09:57
no - bernadette.Haag33 commented on March 19th 20 at 10:00
@bernadette.Haag33,
okay let's make this easy, create a file script.sh content
#!/bin/bash
set-o history
echo ${HISTSIZE}

make it executable:
chmod +x script.sh
run:
bash -v ./script.sh
and show the output - hector.Sipes commented on March 19th 20 at 10:03
5ca25941832ee946126659.png - bernadette.Haag33 commented on March 19th 20 at 10:06
@bernadette.Haag33, so everything works well - hector.Sipes commented on March 19th 20 at 10:09
now, Yes,but pochemune worked in the past? and what is -v? - bernadette.Haag33 commented on March 19th 20 at 10:12
@bernadette.Haag33, 5ca25c6f34b94138540749.png - bernadette.Haag33 commented on March 19th 20 at 10:15
@bernadette.Haag33,
and what is -v?

the key v is used for debugging, so you can see line by line execution of commands
then you can run without that key - hector.Sipes commented on March 19th 20 at 10:18
@nick3iro, Thank you - bernadette.Haag33 commented on March 19th 20 at 10:21
March 19th 20 at 09:32
$(HISTSIZE) - you try to run the command HISTSIZE, which does not exist

To display variable you need or $HISTSIZE or ${HISTSIZE}

Find more questions by tags Linux