Bash shell problem on Fedora Linux


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Bash shell problem on Fedora Linux

My shell environment is bash and desktop environment is LXDE. When I use the up and down button on the keyboard to view the command history on bash shell, many times part of the command from the history remains on the line. For example
Code:
/home/milhan > ssh somedomain.org
/home/milhan >

then when I traverse the history of commands with up arrow key and come back to command prompt, the prompt looks like
Code:
/home/milhan > ssh

and when I press backspace it doesn't delete the ssh. I wasn't able to figure this out for long time. This only happens on my local machine. I ssh to other remote Unix machines where I use bash, but the same annoyance doesn't happen on those machines. I use QTerminal 0.7.1 and the default LXTerminal on my local Fedora Linux pc. Thanks.
# 2  
I am guessing: On the problem box, there is a spurious non-printing character in the environment variable(s) you have defined. I do not know what you have defined, but if you have local (Ex: .bashrc) files or other "hidden" files sprinkled around you have to validate them to locate where you picked up the garbage.

Start with your home directory.

Code:
set | od -c   # check your existing variables for junk
od -c [ .filename ]   # check your initialization and setup files

# 3  
Is that only for that ssh command line, or for other commands / history lines as well?
# 4  
Quote:
Originally Posted by RudiC
Is that only for that ssh command line, or for other commands / history lines as well?
That's hard to say. The above example was just to illustrate the problem. It doesn't do it for every command and when it does, it is always 3 characters. For example, I just tested and the gre from a previous grep command was left in the command prompt.

---------- Post updated at 13:17 ---------- Previous update was at 12:23 ----------

Quote:
Originally Posted by jim mcnamara
I am guessing: On the problem box, there is a spurious non-printing character in the environment variable(s) you have defined. I do not know what you have defined, but if you have local (Ex: .bashrc) files or other "hidden" files sprinkled around you have to validate them to locate where you picked up the garbage.
Code:
/home/milhan > env
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.m4a=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.oga=01;36:*.opus=01;36:*.spx=01;36:*.xspf=01;36::ex=0;35:
_LXSESSION_PID=1786
XDG_CONFIG_HOME=/home/milhan/.config
PREFERRED=/usr/bin/startlxde
XDG_MENU_PREFIX=lxde-
LANG=en_US.UTF-8
HISTCONTROL=ignoredups
DISPLAY=:0.0
HOSTNAME=dellwstation
INVOCATION_ID=0d56a9429cc842f4ba3d84cef4f215bc
IMSETTINGS_INTEGRATE_DESKTOP=yes
KDEDIRS=/usr
XDG_VTNR=1
SSH_AUTH_SOCK=/tmp/ssh-jRqaTqmojPjF/agent.1786
XDG_SESSION_ID=3
USER=milhan
DESKTOP_SESSION=LXDE
IMSETTINGS_MODULE=none
PWD=/home/milhan
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
HOME=/home/milhan
JOURNAL_STREAM=9:28758
SSH_AGENT_PID=1939
XDG_DATA_DIRS=/usr/local/share:/usr/share:/usr/share/gdm:/var/lib/menu-xdg
SAL_USE_VCLPLUGIN=gtk
MAIL=/var/spool/mail/milhan
TERM=xterm
SHELL=/bin/bash
GNOME_KEYRING_CONTROL=/home/milhan/.cache/keyring-VS1SBZ
QT_IM_MODULE=xim
XMODIFIERS=@im=none
XDG_CURRENT_DESKTOP=LXDE
XDG_SEAT=seat0
SHLVL=2
COLORFGBG=15;0
LANGUAGE=
WINDOWID=0
LOGNAME=milhan
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/milhan/.Xauthority
XDG_DATA_HOME=/home/milhan/.local/share
XDG_CONFIG_DIRS=/etc/xdg
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/milhan/bin:
PS1=\e[0;32m\n`whoami`@`uname -n | cut -d "." -f 1 ` :: `echo "$(date) $QUOTE"`\n`pwd` >\e[m 
HISTSIZE=
LESSOPEN=||/usr/bin/lesspipe.sh %s
GTK_IM_MODULE=gtk-im-context-simple
_=/bin/env

# 5  
It's the three non-printing terminal reset characters at the end of the PS1 string that increase the char count output and thus the "length" of the prompt string that the shell takes into account. Try embedding those by enclosing in the correct codes. man bash:

Quote:
PROMPTING
.
.
.
\[ begin a sequence of non-printing characters, which could be used to embed a terminal control sequence into the prompt
\] end a sequence of non-printing characters
This User Gave Thanks to RudiC For This Post:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
UNIX Korn Shell to Linux Bash
cpremesh
Migrating Unix batch jobs (Korn Shell) running in HP-UX server to Linux environment. Hi All Please help me to understand the easiest way to migrate Kernel Shell scripts to Linux Bash. Also let me know 1. Any automated scripts or tools available for this. 2. Challenges and issues...... Shell Programming and Scripting
5
Shell Programming and Scripting
problem with rsh in bash shell
InduInduIndu
Hello All, I am trying to gather output of df -k from remote server to local server using below line: rsh <host> df -k >/tmp/space_remote_host.txt Why above throws following error message:(I've deleted the IP address in below chunk) connect to address ..: Connection refused Trying...... Shell Programming and Scripting
2
Shell Programming and Scripting
LINUX Bash Shell Script
help123
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a bash shell script that presents work information of employees of a department from a company data...... Homework & Coursework Questions
1
Homework & Coursework Questions
PLEASE HELP! LINUX BASH SHELL SCRIPT
help123
PLEASE HELP! NEED LINUX SCTIPT Need to write a bash shell script to show information of employees of a department from a company data set. The script should accept a project number (1/2/3/10/20/30) and output * the name of the project * the name of the manager of the controlling...... Shell Programming and Scripting
1
Shell Programming and Scripting
problem with while loop in BASH shell
npatwardhan
I have file named script1 as follows: #!/bin/bash count="0" echo "hello" echo "$count" while do echo "$count" count=`expr $count + 1` done ----------- when I run it, I get ./script1: line 9: syntax error near unexpected token `done' ./script1: line 9: `done' I...... Shell Programming and Scripting
6
Shell Programming and Scripting