shell variables
Is there a command or a man page where I could view the shell variables available? I have a test tomorrow and we can use the man pages or built in commands, but not text files. I don't feel like memorizing them.
|
man bash
|
do man then name of shell!!!
Yes right when u do man <name of shell> say man bash, you will see that shell's available keyword and variables.
|
Quote:
|
Sounds strange.. At least on my machine, the IP address(s) are not stored in any environment variable that I'm aware of. What have you tried so far to look at the environment variables that ARE configured, and WHERE exactly are you looking, when you say "perhaps it's not listed"?
Also, it's a good practice to tell us what Linux, and which shell (if applicable) you are using. In this particular case, neither of these really matter a great deal, but as a rule, if you're looking for help, let us know what Linux you are running (especially as it seems you are posting from Windows). Kind regards, and welcome to LQ :) Sasha |
Quote:
Using values from Environment Variables only, identify the following? Your computer’s IP address: _____________________ (Variable Name: ____________________) This assignment is only for practice for the test, so it isn't crucial. Worst comes down to it, I lose a few marks on the test. Also thanks. :) |
Hmm.. Well, for your info, check out the man page for the `env` command, just for educational reasons. You will see there a way to use the `env` command to view the currently configured environment, that is, all currently set environment variables.
Maybe CentOS has one set to the current IP. Sasha |
Quote:
@thehollow89 You can try this command to find a variable. Code:
set | grep "[0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+" |
Quote:
:) |
Interesting...."env" does not include anything with my IP. I also cannot find it anywhere in /proc. So where IS is stored??
|
Define "IP". There's 127.0.0.1, of course, but your IP is also every single IP between you and the world (this can be a lot of IPs, with NAT around).
|
I meant the IP for my computer--as reported by "ifconfig". This is--I think--unambiguously my address as seen from outside my box. Obviously, if I'm on a router, someone on the other end will see something else.
|
Quote:
Look on the left bottom corner on any post. |
Yah.. I haven't noticed that until now. :D
|
Well, I ran 'set' and 'env' on my system (Centos 5.4) and it's definitely not there. I can only imagine that the test machine will have it set specifically and you'll see it with one of those cmds.
|
All times are GMT -5. The time now is 07:22 PM. |