MandrivaThis Forum is for the discussion of Mandriva (Mandrake) Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I wanted to type: g++ , but i forgot to press shift key while typing ++ so, == was typed instead,then i pressed enter without knowing about my mistake.Then i saw g== entered, but i do not know what it is ,or what it does.
I do not know also how to undo commands (if possible),i just read somewhere that pressing arrow up acts as history of commands,and commands could be edited this way,so i did that,but still g== was on history.
Don't worry; all you did was to set shell variable $g to =
Code:
c@CW8:~$ g==
c@CW8:~$ echo $g
=
EDIT: acid_kewpie beat me to it
Hi
I am not worried any more,but since g++,c++.seem to be development tools,and i have started to use them ,so i want to keep them clean and with no mistakes.
Your intentions seem honourable, but it doesn't really make sense in this context, so don't worry about it, you're in no danger of damaging anything.
Hi
I do not know about shell variables and what they can do,but my supposition is that whenever i press and enter = on terminal,then probably it will act ,since i do not know what would be the action,i am concerned about that. Of course i am going to learn about shell variables by studying ....
Thank you.
Every time you enter something at the command line of a shell, it will assume that the first thing on the command line is a command. It begins by parsing the command using characters defined in an environment variable called $IFS (internal field separator). But you can safely assume that means "white space" (See http://www.livefirelabs.com/unix_tip...3/10132003.htm). So the shell splits up the command into "words" which are collections of characters it has parsed out using white space for the delimiter. It then assumes that the first word is a command and checks to see if it is a command build into the shell itself. If not, it attempts to find the command (looking in paths defined in the $PATH environment variable), and if found it runs the command, handing the command all remaining words that were on your command line.
If you want, try typing "=" and hitting enter. See what happens. It should tell you that the "=" command was not found. If you don't get some message like that, then the shell did find some command to run or it handled the command itself. So, when you typed "g==" and hit enter, it did not look for a command to run, because from its perspective, this was a valid shell command, setting a variable to the value =.
Understanding this much should get you a bit farther along and should dispel some of your concerns.
ALSO: you can use the "which" and "whereis" commands to find out where the shell is finding a command or if it will find it at all:
whereis <some command>: tells you all the different places it could look (defined in $PATH) to find a command.
which <some command>: tells you exactly which of the possibilities it is really going to run for you
Example:
admvrm@vrmartinplmdevv6suse:~> which gcc
/usr/bin/gcc
admvrm@vrmartinplmdevv6suse:~>
Every time you enter something at the command line of a shell, it will assume that the first thing on the command line is a command. It begins by parsing the command using characters defined in an environment variable called $IFS (internal field separator). But you can safely assume that means "white space" (See http://www.livefirelabs.com/unix_tip...3/10132003.htm). So the shell splits up the command into "words" which are collections of characters it has parsed out using white space for the delimiter. It then assumes that the first word is a command and checks to see if it is a command build into the shell itself. If not, it attempts to find the command (looking in paths defined in the $PATH environment variable), and if found it runs the command, handing the command all remaining words that were on your command line.
If you want, try typing "=" and hitting enter. See what happens. It should tell you that the "=" command was not found. If you don't get some message like that, then the shell did find some command to run or it handled the command itself. So, when you typed "g==" and hit enter, it did not look for a command to run, because from its perspective, this was a valid shell command, setting a variable to the value =.
Understanding this much should get you a bit farther along and should dispel some of your concerns.
ALSO: you can use the "which" and "whereis" commands to find out where the shell is finding a command or if it will find it at all:
whereis <some command>: tells you all the different places it could look (defined in $PATH) to find a command.
which <some command>: tells you exactly which of the possibilities it is really going to run for you
Example:
admvrm@vrmartinplmdevv6suse:~> which gcc
/usr/bin/gcc
admvrm@vrmartinplmdevv6suse:~>
I am studying about shell commands...etc,but it seems still a long way to understand and learn enough.
Yesterday i tried to undo or reverse the command g== by typing
unset g== but, output showed no success.(probably it was : no such file or...),so if i have set shell variable to = (as friend katkin said before),then why wasn,t that unset later?
My understanding which caused posting LQ ,is that some times a small change can cause a great deviation in the long run,so one should know what he/she is doing,specially in cases which are valued more,and to me g++, c++ are more important because of their capabilities.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.