When I type history at the prompt I should be getting a list of all the commands that i used but instead i'm getting this message:
Can anyone tell me why and how i can fix this?Code:skynet@skynet-desktop~ $ history bash: $1: unbound variable
When I type history at the prompt I should be getting a list of all the commands that i used but instead i'm getting this message:
Can anyone tell me why and how i can fix this?Code:skynet@skynet-desktop~ $ history bash: $1: unbound variable
sudo --JK
bump
sudo --JK
Though I am not sure, but can you try this:
Code:echo $anything
When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark it [SOLVED] if the issue has been resolved
Thanks for your reply but that didn't solve the problem for me.
Code:skynet@skynet-desktop~/Documents $ echo $anything bash: anything: unbound variable
sudo --JK
The command:
produces a similar behavior. You can reset it like this:Code:$ set -u
However, if it happens always you open a terminal, it means it is set in some of the bash files. Have you mod any of these files?Code:$ set +u
/etc/profile
/etc/bash.bashrc
/etc/bash.bash.logout
~/.bash_profile
~/.bashrc
~/.bash_logout
~/.inputrc
Last edited by papibe; October 11th, 2010 at 06:16 AM.
That won't change anything. Actually I was just checking whether your shell is behaving like "set -u" or not. Looks like it is
Did you try what papibe said ? I am not able to reproduce your error if I set 'set -u' in my active shell so can't say if papibe's solution will help or not
Last edited by luvshines; October 11th, 2010 at 06:27 AM. Reason: Added info
When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark it [SOLVED] if the issue has been resolved
Thanks for your reply!
I executed the set +u command but it's not behaving like it should.
Instead it's giving me a list of what the most recent activities are.
And YES, maybe a month ago I downloaded a Terminal theme, copied and pasted over the existing .bashrc texts. I have it saved somewhere else. Should I have copied it below the exisitng .bashrc text?
So here is what I get when i type history:
Code:2010-10-11 03:12:00 status half-configured avant-window-navigator-data-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:00 status installed avant-window-navigator-data-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:00 configure avant-window-navigator-trunk 0.4.1~bzr743+201009122042~lucid1 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:00 status unpacked avant-window-navigator-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:00 status half-configured avant-window-navigator-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:00 status installed avant-window-navigator-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:00 status triggers-pending libc-bin 2.11.1-0ubuntu7.2 2010-10-11 03:12:01 configure awn-applets-c-core-trunk 0.4.1~bzr1435-1.10.04 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status unpacked awn-applets-c-core-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status half-configured awn-applets-c-core-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status installed awn-applets-c-core-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 configure awn-applets-c-extras-trunk 0.4.1~bzr1435-1.10.04 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status unpacked awn-applets-c-extras-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status half-configured awn-applets-c-extras-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status installed awn-applets-c-extras-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 configure awn-applets-python-core-trunk 0.4.1~bzr1435-1.10.04 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:01 status unpacked awn-applets-python-core-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 status half-configured awn-applets-python-core-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 status installed awn-applets-python-core-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 configure awn-applets-python-extras-trunk 0.4.1~bzr1435-1.10.04 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 status unpacked awn-applets-python-extras-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 status half-configured awn-applets-python-extras-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 status installed awn-applets-python-extras-trunk 0.4.1~bzr1435-1.10.04 2010-10-11 03:12:02 configure awn-settings-trunk 0.4.1~bzr743+201009122042~lucid1 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:02 status unpacked awn-settings-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:02 status half-configured awn-settings-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:02 status installed awn-settings-trunk 0.4.1~bzr743+201009122042~lucid1 2010-10-11 03:12:03 trigproc libc-bin 2.11.1-0ubuntu7.2 2.11.1-0ubuntu7.2 2010-10-11 03:12:03 status half-configured libc-bin 2.11.1-0ubuntu7.2 2010-10-11 03:12:03 status installed libc-bin 2.11.1-0ubuntu7.2
sudo --JK
Atleast it gives something now
For future, first backup the working files and then try nething new
For now, just check if history command has not be aliased:
Also, check the following:Code:alias | grep -i history
If you find something like HISTFILE, open the specified file and see if history is actually there or not(No need to paste it here)Code:set | grep "^HIST"
Last edited by luvshines; October 11th, 2010 at 04:44 PM. Reason: Added info
When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark it [SOLVED] if the issue has been resolved
Much appreciated!
The HISTFILE which is .bash_history DOES show all the list of commands I executed so it's saving it, and that's good.
As for the aliasing when i typed 'alias | grep -i history', it shows this:
So, this is from the .bashrc theme that i said i pasted about a month ago. I'm going to guess at this but should it be:Code:skynet@skynet-desktop~/Documents/Test $ alias | grep -i history alias alert_helper='history|tail -n1|sed -e "s/^\s*[0-9]\+\s*//" -e "s/;\s*alert$//"' alias h='history | grep $1' alias hgrep='history | grep --color=always' alias history='apt-history' alias historyi='apt-history install' alias historyre='apt-history remove' alias historyro='apt-history rollback' alias historyu='apt-history upgrade' alias top-commands='history | awk "{print $2}" | awk "BEGIN {FS="|"} {print $1}" |sort|uniq -c | sort -rn | head -10'
I don't even know why the theme creator even aliased history...Code:alias history='history'
Also I did have the default .bashrc saved as .bashrc-backup, so i can retrieve it anytime.
Last edited by juil; October 11th, 2010 at 05:35 PM.
sudo --JK
Actually it should not be aliased at all. To run it unaliased temporarily, just do:
unalias keywork will last only for the session in which it was invoked. The '\' calling will be only for that single instance of callCode:unalias history; history OR \history
For a permanent solution, just see where the aliases have been defined for history, comment them out, save it and exit that shell. Then open a new one to see the changes.
PS: Oh by the way, for the set +u thing, where did you make the change ??
Last edited by luvshines; October 11th, 2010 at 08:03 PM. Reason: Improved beauty cosmetics
When you have eliminated the impossible, whatever remains, however improbable, must be the truth !!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Mark it [SOLVED] if the issue has been resolved
Bookmarks