Random gives a number between 0-32767 as 32768 is notable in computer science for being the absolute value of the maximum value of a 16-bit signed integer.
32767 = 2^15 - 1 = sum of 2^n from 0 to 14 inclusive. Silly question though, why don't they use an unsigned int? Since RANDOM output is always positive anyway
Quite useful info. Most Linux beginners will find your video super helpful to understand the basics of Environment Variables whether they use the command line regularly or occasionally.
The PATH stuff was getting to me. I have been wanting to dig deeper into this but never did. Your short and sweet description on how to add paths was a Godsend!
Great video! Thanks for the education. Like a script-kiddie, I was just copy/pasting the line: PATH="$HOME/Applications:$PATH" (changing "Applications" to whatever I needed to add) without fully understanding the simple syntax. Now I do. This means worlds to me! I also agree that a playlist of these UNIX/Linux/POSIX commands would be great to help find them all.
Thx. for doing great job on this channel. Currently I'm migrating back to Linux. Currently I'm struggeling to set up my printer (ET-3750). But I guess it's just a matter of setting the right permissions or the right environment variables..... Your channel is doing a great job bringing me back up to speed!
Hey DT! Can you make a playlist with ordered tutorials for absolute beginners at GNU/Linux? A playlist that would include an explanation about what is GNU/Linux, how it came to be, what is POSIX compliance, how it differs from other Unix-like systems, then the basics about the OS, basics of the bash shell, why FOSS matters, etc. You already have made a lot of videos about those topics, so you could make shorter versions, in which you could link to longer versions, or just link the existing ones in order. (Shorter because people these days have attention span on the level of a goldfish) A lot of people I know want to switch to GNU/Linux because now Proton supports GNU/Linux gaming, it would be neat to point them to a propper source where they would get proper and good knowledge about GNU/Linux and FOSS, instead of not knowing much and being sheep who distro hop because they do not know how to properly configure things, or think the wrong things about GNU/Linux.
Actually, Environment variables are defined in the process that run any program, not just Shells. And in Bash, and other Shells, there are variables in the Shell (Bash has both local and global variables in the Shell). Environment variables are the ones in the process. The Good thing is that Environment variables are copyed to the child process. Then the parent process can't change them for the child process. And No process can change any other process Environment variables. Not even the patents. MS Dos have global Environment variables, so any process can change any other programs Environment variables. Which is bad.
Isn't Dos basically single process though? I'd think that that would mitigate that problem pretty well... Unless future scripts don't initialize their variables properly.
hey dt!, i have a question, how can i make the dtos installer?, like when you launch dtos installer it is a GUI INSIDE TERMINAL LIKE NCURSES HOW CAN I DO THAT?
do this in a shell to get a behavioral idea: echo ~ echo "~" echo $HOME echo "$HOME" basically, $HOME is a variable, ~ is something more like a glob (It's not technically a glob). You'll notice that when quoted, the variable is expanded, but ~ is not.
@@Gabifuertes I can understand an alternative terminal but can't quite get why someone would use a terminal to open another terminal. Unless of course there are circumstances (of which I am not aware) whereby one terminal is preferable to another.
Hello, i just watched you video about irssi, and do you know some chat program like this one? but safety and privacy... Or batter, maybe could you teach how create a chat between two computer? wait, a better topic, if you know could you please make a video about cryptography, and the asymmetric cryptography, and the most important, how to apply the asymmetric, because for example , I know about it, but I don't really know how to use it, how to implement and so on and so forth. Or maybe anyone who is reading this comment could please send me a video or a site or a book about it please
I don't have mouseface. not in repo. I found it in Github. Can someone please tell me the command to download it. The Github-clueless among us would appreciate it. I do have fortune though. The first time I tried it I got this : Q: How many existentialists does it take to screw in a light bulb? A: Two. One to screw it in and one to observe how the light bulb itself symbolizes a single incandescent beacon of reality in a netherworld of endless absurdity reaching out to a maudlin cosmos of nothingness.
It's a pity there's not a good "shell agnostic" way of setting global environment variables for things like XDG compliance... at least not when you include the fish shell in the criteria for "shell agnostic." I know you could edit .profile or /etc/profile or something... but the whole point of forcing XDG compliance is to get rid of things like .profile. I suppose you could set the default shell to bash and just have bash set the variables and launch fish, and I think the variables might persist to the fish session and your desktop environment... but eh. Such a hack.
No, XGD are not about remove /etc/profile etc. It is about being able to use locale adjusted directories, like ~/Document is used in English locale and ~/Dukument in Swedish. And config files in ~/.config etc. Has nothing to do with Shell init files. You still need Them That is what the environmen
@@AndersJackson I never said it was supposed to get rid of anything in /etc... but /etc is beyond the scope of user configuration, so changes there can't easily be stored in a dotfiles repo. You literally just said XDG is so that user configuration goes in ~/.config. ~/.profile, ~/.vim, ~/.ssh, etc literally all violate this. It should be ~/.config/profile, ~/.config/vim, ~/.config/ssh, etc. fish is the only shell that respects XDG (though you can sort of force zsh to do so by setting ZPROFILE early enough... though you'd probably need to face the same sort of conundrum to do so.
Bro can you make a video on how we can setup our own cross platform terminal that can run all the commands of bash and cmd it will be really cool if you could make a video on this topic.
I'm gonna try to offer some constructive criticism, since I feel like this was of lower quality than, say, your org-mode videos. One mistake you're making here is trying to reword and rename concepts, to the point of being technically wrong. For instance, your usage of "local" vs "global" variables doesn't match what is actually local vs global variables in shell scripting. You meant "variables" vs "environment variables", because that's what Bash (and POSIX) names them. Questions that I think should have been answered in the video: - What is a variable? - What is the environment? - How do you add, change or remove a variable in the environment? - How do you modify the environment only for the child process? - What are the standard ways to persistently customize the environment? That last one is the single most useful information for people that don't want to dive into shell programming, yet you devoted the least amount of time to it. - "Why does my PATH have the same location twice?" - "Why does my shell see the variable, but the script I invoke doesn't?" - "Why isn't ~/.config/environment.d working is the documentation says it should work?" (Spoiler: because systemd.)
not sure but in one video he says that he read holy books of many religions like the bible, Quran, Bhagavad Gita If anyone notices that he also have lord buddha statute
Sorry DT but there are actual definitions for concepts of local and global variable, and that's not it. Since you're being (for a good reason!) followed by total newbies, you really shouldn't be playing it fast and loose. Oher people may at a later point need to un-teach incorrect concepts before they can learn correct ones; and that's a bi*ch job.
Random gives a number between 0-32767 as 32768 is notable in computer science for being the absolute value of the maximum value of a 16-bit signed integer.
Or just the largest value of an unsigned 16-bit integer 🙃
@@michaelhoefler5118 no, a 16 bit unsigned integer has values from 0 to 65535
32767 = 2^15 - 1 = sum of 2^n from 0 to 14 inclusive. Silly question though, why don't they use an unsigned int? Since RANDOM output is always positive anyway
@@michaelhoefler5118 largest value of 16 bit *signed integer.
@@rcht9586 yes! You are right. My bad!
Yes, please more videos on these UNIX/POSIX standards, whatever you call these.
Quite useful info. Most Linux beginners will find your video super helpful to understand the basics of Environment Variables whether they use the command line regularly or occasionally.
The PATH stuff was getting to me. I have been wanting to dig deeper into this but never did. Your short and sweet description on how to add paths was a Godsend!
Daniel: echo $VAR
The cooler Daniel: printenv VAR
It's the other way around. All the cool kids do echo $VAR.
printenv's rarity makes it cooler (?)
Great video! Thanks for the education.
Like a script-kiddie, I was just copy/pasting the line: PATH="$HOME/Applications:$PATH" (changing "Applications" to whatever I needed to add) without fully understanding the simple syntax. Now I do. This means worlds to me!
I also agree that a playlist of these UNIX/Linux/POSIX commands would be great to help find them all.
Awesome content DT cheers from Spain
Title should be “Environment Variable for 8years olds…” it’s actually that CLEAR !!! Thanks, man.
Thank u. I thought installing arch would be really hard ; but your previous tutorial videos had really taught me a lot about that
love the explaination, why can't people keep videos nice and simple like this.
Thx. for doing great job on this channel. Currently I'm migrating back to Linux. Currently I'm struggeling to set up my printer (ET-3750). But I guess it's just a matter of setting the right permissions or the right environment variables.....
Your channel is doing a great job bringing me back up to speed!
Wow DT. Your lighting is getting better and better
You're looking lean bro. Great video.
THANK YOU!
Hey DT, the range 32767 is int with size 2 (byte). So for a variable defined with integer size 2 can store -32768 to 32767. Thanks for the videos.
How about videos about making POSIX compliant Scripts or POSIX compliance in general???
shellcheck
he uses fish
@@zvezdan956 It's worth a shot
I need this info in a cheat sheet, i forget it everytime i need it, as long as its in Bash, it never changes
@@Muffin_Stuffin or markdown, it's less verbose than html
@@TrueDetectivePikachu markdown is great for this purpose, and if you need it as html there's pandoc
You are very good and decently detailed with you presentations. How many years will it take a newbie to get to your level?
Wow! your T-Shirt is so awesome 😃
Hey DT!
Can you make a playlist with ordered tutorials for absolute beginners at GNU/Linux?
A playlist that would include an explanation about what is GNU/Linux, how it came to be, what is POSIX compliance, how it differs from other Unix-like systems, then the basics about the OS, basics of the bash shell, why FOSS matters, etc.
You already have made a lot of videos about those topics, so you could make shorter versions, in which you could link to longer versions, or just link the existing ones in order. (Shorter because people these days have attention span on the level of a goldfish)
A lot of people I know want to switch to GNU/Linux because now Proton supports GNU/Linux gaming, it would be neat to point them to a propper source where they would get proper and good knowledge about GNU/Linux and FOSS, instead of not knowing much and being sheep who distro hop because they do not know how to properly configure things, or think the wrong things about GNU/Linux.
How dare you insult me with that " people these days have attention span of goldfish"
Please say sorry
I have can have a small attention span like a goldfish but when I am @Linux it can be as long as 3-4 hours
Just the video I was looking for! Thanks
Why if I put my envs in zprofile or zshenv system doesn't see they? For example sxhkd can't use it.
Actually, Environment variables are defined in the process that run any program, not just Shells.
And in Bash, and other Shells, there are variables in the Shell (Bash has both local and global variables in the Shell).
Environment variables are the ones in the process.
The Good thing is that Environment variables are copyed to the child process. Then the parent process can't change them for the child process.
And No process can change any other process Environment variables. Not even the patents.
MS Dos have global Environment variables, so any process can change any other programs Environment variables. Which is bad.
Isn't Dos basically single process though? I'd think that that would mitigate that problem pretty well... Unless future scripts don't initialize their variables properly.
So DOS runs into a similar problem as if one were to attempt to use EMACS as an OS?
btw have u tried river? a tiling window manager for wayland?
Hey DT, how do you colourize your ls command?
I believe his “ls” is actually an alias for the program “exa” which is an alternative to ls with more features
Yup dt uses exa and the set ls as an aliaz
@@HontoNeet oh, thanks for the information!
I keep on learning 😊
thank you Very Much
love the T-Shirt
do you have any dotfiles for the specific qtile or something else I think window manger setup?
hey dt!, i have a question, how can i make the dtos installer?, like when you launch dtos installer it is a GUI INSIDE TERMINAL LIKE NCURSES HOW CAN I DO THAT?
Cool T-shirt man, where buy??
can someone explain the difference between ~ and $HOME. When should you use one over the other?
@Obvious Honeypot what shell doesn't support ~?
use $HOME in scripts for better compatibility, and ~ in commands.
That print on his T-shirt is of religious Goddess in Hinduism...
Thanks!
Great video
Surprised it isn’t uid == 0, typically in programming, you need two = for equality check. Single = is for assigning value to a variable.
You can use == with the shell built-in that starts with [[ and end with ]]>
Bash accepts both '==' and '=' for string equality comparison. '=' is usually used with the 'test' command for POSIX conformance.
What is a Hindu Goddess doing on your t-shirt ?
PS: Nice video!
Thanks
Sir when is DTOS coming sir pls reply waiting for it eagerly
When it's ready
Why do Indians always say "sir"?
@@peenywallie I suppose it must be good etiquette in their languages.
Difference between $HOME AND ~/ ??
same thing in the man page of ls or something idr, "~" is almost always $HOME .
do this in a shell to get a behavioral idea:
echo ~
echo "~"
echo $HOME
echo "$HOME"
basically, $HOME is a variable, ~ is something more like a glob (It's not technically a glob). You'll notice that when quoted, the variable is expanded, but ~ is not.
@@killistan
Wow i just try it and it blew my mind .
~ is rigged .
@@xrafter Yeah, almost always use $HOME in scripts, but who wants to type that in the command line all the time?
Thanks to everyone
Hey dt, have you heard of ‘darling’(it’s like wine for Macos)... Btw very informational video
thank youuuu
Why would someone use a sub shell?
Try fish and you'll be invoking bash for opening scripts or just out of frustration
@@Gabifuertes I can understand an alternative terminal but can't quite get why someone would use a terminal to open another terminal. Unless of course there are circumstances (of which I am not aware) whereby one terminal is preferable to another.
Hello, i just watched you video about irssi, and do you know some chat program like this one? but safety and privacy... Or batter, maybe could you teach how create a chat between two computer? wait, a better topic, if you know could you please make a video about cryptography, and the asymmetric cryptography, and the most important, how to apply the asymmetric, because for example , I know about it, but I don't really know how to use it, how to implement and so on and so forth. Or maybe anyone who is reading this comment could please send me a video or a site or a book about it please
Is it goddess Kali maa in your tshirt
I guess yes
32767 is the maximum number you can represent with 15 bits. I don't know why they used 15 bits for it, though.
it's the max of a signed 16 bit number so -32768 to 32767
@@hughesd.mungus9819 Oh it's signed...
do a video on hannah montana linux
I don't have mouseface. not in repo. I found it in Github. Can someone please tell me the command to download it. The Github-clueless among us would appreciate it. I do have fortune though. The first time I tried it I got this : Q: How many existentialists does it take to screw in a light bulb? A: Two. One to screw it in and one to observe how the light bulb itself symbolizes a single incandescent beacon of reality in a netherworld of endless absurdity reaching out to a maudlin cosmos of nothingness.
👍
It's a pity there's not a good "shell agnostic" way of setting global environment variables for things like XDG compliance... at least not when you include the fish shell in the criteria for "shell agnostic." I know you could edit .profile or /etc/profile or something... but the whole point of forcing XDG compliance is to get rid of things like .profile.
I suppose you could set the default shell to bash and just have bash set the variables and launch fish, and I think the variables might persist to the fish session and your desktop environment... but eh. Such a hack.
No, XGD are not about remove /etc/profile etc.
It is about being able to use locale adjusted directories, like ~/Document is used in English locale and ~/Dukument in Swedish. And config files in ~/.config etc.
Has nothing to do with Shell init files. You still need Them
That is what the environmen
@@AndersJackson I never said it was supposed to get rid of anything in /etc... but /etc is beyond the scope of user configuration, so changes there can't easily be stored in a dotfiles repo.
You literally just said XDG is so that user configuration goes in ~/.config. ~/.profile, ~/.vim, ~/.ssh, etc literally all violate this. It should be ~/.config/profile, ~/.config/vim, ~/.config/ssh, etc.
fish is the only shell that respects XDG (though you can sort of force zsh to do so by setting ZPROFILE early enough... though you'd probably need to face the same sort of conundrum to do so.
Make those local scripts functions.
I just realized you have /home/dt/.local/bin in your path twice
$ p='Hello. '
$ echo $p
Hello,
$ p+='world!'
$echo $p
Hello, world!
Thats a 'KALI' on his t-shirt
Bro can you make a video on how we can setup our own cross platform terminal that can run all the commands of bash and cmd it will be really cool if you could make a video on this topic.
it is 32767 because it uses 16 bits to store
Niceee!
👏👏👏
BTW I use fish
You have an extra /home/dt/.local/bin in your $PATH just fyi...
I use MS DOS
Can you please use timestamps on your videos? thanks
First?
I'm gonna try to offer some constructive criticism, since I feel like this was of lower quality than, say, your org-mode videos.
One mistake you're making here is trying to reword and rename concepts, to the point of being technically wrong.
For instance, your usage of "local" vs "global" variables doesn't match what is actually local vs global variables in shell scripting. You meant "variables" vs "environment variables", because that's what Bash (and POSIX) names them.
Questions that I think should have been answered in the video:
- What is a variable?
- What is the environment?
- How do you add, change or remove a variable in the environment?
- How do you modify the environment only for the child process?
- What are the standard ways to persistently customize the environment?
That last one is the single most useful information for people that don't want to dive into shell programming, yet you devoted the least amount of time to it.
- "Why does my PATH have the same location twice?"
- "Why does my shell see the variable, but the script I invoke doesn't?"
- "Why isn't ~/.config/environment.d working is the documentation says it should work?" (Spoiler: because systemd.)
Waffelo
Are you supporting hindu religion 🤔 (t-shirts)
doesn't necessarily mean so
not sure but in one video he says that he read holy books of many religions like the bible, Quran, Bhagavad Gita
If anyone notices that he also have lord buddha statute
Sorry DT but there are actual definitions for concepts of local and global variable, and that's not it. Since you're being (for a good reason!) followed by total newbies, you really shouldn't be playing it fast and loose. Oher people may at a later point need to un-teach incorrect concepts before they can learn correct ones; and that's a bi*ch job.
11:02 You can just do $PATH+=:/path_to_dir
Thanks