LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-18-2015, 03:27 AM   #1
1300
Member
 
Registered: Nov 2011
Posts: 48

Rep: Reputation: Disabled
history command


I have noticed that if I entered "space" before the command I am welling to execute! it will not appear in #history command

how to fix this bug ?
 
Old 05-18-2015, 03:47 AM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Depends on how you have your bashrc configured. It's not a bug but a configuration and a non-default one at that. Take for example the following from my bashrc.

Code:
export HISTIGNORE="&:ls:[bf]g:exit:history:history2"
export HISTCONTROL="ignorespace:ignoredups:&:ls:[bf]g:exit:history:history2"
The HISTCONTROL environment variable, specifically the value ignorespace, will ignore commands that start with a space. From the bash man page,

Quote:
HISTCONTROL
A colon-separated list of values controlling how commands are saved on the history list. If the list of values includes ignorespace, lines which begin with a space character are not saved in the history list. A value of ignoredups causes lines matching the previous history entry to not be saved. A value of ignoreboth is shorthand for ignorespace and ignoredups. A value of erasedups causes all previous lines matching the current line to be removed from the history list before that line is saved. Any value not in the above list is ignored. If HISTCONTROL is unset, or does not include a valid value, all lines read by the shell parser are saved on the history list, subject to the value of HISTIGNORE. The second and subsequent lines of a multi-line compound command are not tested, and are added to the history regardless of the value of HISTCONTROL.
It's definite that you're configuring HISTCONTROL=ignorespace somewhere in your bash configurations. See the man page for what files bash loads as configuration.

Last edited by sag47; 05-18-2015 at 03:49 AM.
 
Old 05-18-2015, 11:06 AM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,143

Rep: Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350Reputation: 1350
The setting could also be "ignoreboth", which is just shorthand for "ignorespace" and "ignoredups".
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does BASH history command have no history when run in script ? lump_of_lard Programming 4 01-30-2015 10:45 AM
history command nabendu Linux - Software 6 12-26-2014 10:26 PM
[SOLVED] timestamp of command history doesn't show time command was executed? UprLftCstr Linux - Newbie 3 04-17-2014 01:31 PM
[SOLVED] Is there any command to delete bash command history? cola Linux - Newbie 4 06-01-2010 08:32 AM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 03:14 AM


All times are GMT -5. The time now is 08:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration