LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 03-10-2020, 01:22 PM   #1
Guru prasad
LQ Newbie
 
Registered: Mar 2020
Location: India
Distribution: Slackware64_14.2
Posts: 2

Rep: Reputation: Disabled
Question Dash shell command history not working


Hi,

Recently I switched my default shell from bash to dash. Now when I press arrow keys in the terminal to get back command history, I get ^[[A or ^[[C. I tried with HISTFILE option but didnt work..I want to use dash shell with history enable option..Please help me...
 
Old 03-10-2020, 01:50 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,509

Rep: Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735
Quote:
Originally Posted by Guru prasad View Post
Hi,
Recently I switched my default shell from bash to dash. Now when I press arrow keys in the terminal to get back command history, I get ^[[A or ^[[C. I tried with HISTFILE option but didnt work..I want to use dash shell with history enable option..Please help me...
Did you read the man page on the dash shell? Look at the HISTSIZE option and set it. And I'd ask why you'd change the default shell to start with...what is your goal? What are you trying to get with the dash shell that bash doesn't give you?
 
Old 03-10-2020, 06:33 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,016

Rep: Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877Reputation: 3877
Welcome to LinuxQuestions.

Not a HISTFILE or HISTSIZE problem.

What you are seeing is the shell's interpretation of the up and down arrow key codes. When you switched to dash, the shell appears to not have read the keybindings. Since dash uses the same keybindings file as bash i.e. inputrc and without knowing what distribution you are running my first suggestion would be to just log out then back in.

You can also try running the command:
bind -f /etc/inputrc

What happens if you start anouther terminal window?

Last edited by michaelk; 03-10-2020 at 08:45 PM.
 
3 members found this post helpful.
Old 03-10-2020, 08:27 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 23,509

Rep: Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735Reputation: 6735
Quote:
Originally Posted by michaelk View Post
Welcome to LinuxQuestions.

Not a HISTFILE or HISTSIZE problem.

What you are seeing is the shell's interpretation of the up and down arrow key codes. When you switch to dash the shell appears to have read the keybindings. Since dash uses the same keybindings file as bash i.e. inputrc and without knowing what distribution you are running my first suggestion would be to just log out then back in.

You can also try running the command:
bind -f /etc/inputrc

What happens if you start anouther terminal window?
Nice one; didn't consider that. I've had it happen before with dash, but I have only used it once or twice, and it was because of HISTSIZE being set to 0. But you're absolutely right, though, when you think about the escape sequences being presented on the screen. Perfect sense, good catch.
 
1 members found this post helpful.
Old 04-03-2020, 03:09 AM   #5
Guru prasad
LQ Newbie
 
Registered: Mar 2020
Location: India
Distribution: Slackware64_14.2
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Did you read the man page on the dash shell? Look at the HISTSIZE option and set it. And I'd ask why you'd change the default shell to start with...what is your goal? What are you trying to get with the dash shell that bash doesn't give you?
Sorry for the very late reply....I am trying dash because it is very minimal....Apparently by setting dash to vim mode solved the problem...Thank you all for your suggestions...

Last edited by Guru prasad; 04-03-2020 at 03:10 AM.
 
  


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
[SOLVED] Dash shell script variable expansion problems ;/ Kaurin Linux - Newbie 8 02-01-2013 03:18 PM
dash not working on newly installed 11.10 version kanodapogs Linux - Newbie 4 11-14-2011 02:31 AM
Gnome-Shell/Unity Dash like application for Gnome 2? anon02 Linux - Software 6 10-28-2011 10:34 AM
Gnome Shell installed via Fedora Repo's doesn't have Dash joker_dk Linux - Desktop 21 03-10-2011 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:31 PM.

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
Open Source Consulting | Domain Registration