Hi all
I am relatively new to linux (specifically red hat). I have installed Fedora 13 on my machine and started playing with the terminal when i found a very strange behavior when typing a command that is not found:
the terminal does not prompt me back. In other words, i am logged as root (or any user) and type "bla bla bla" the bash replies "command not found" but the cursor stays besides "command not found" and does not display the prompt $(the PS1). Moreover, whatever i type in this strange phase goes without any response, be it a real command (like exit) or any garbage. This phase only ends when i press control+c.
Strange enough, when i type control-z it gives me what i typed (the grabage) and a job number and informs me that the job is stopped (as if a typed a real command that takes a lot of time to run and i am suspending it).
This behavior only happens in BASH, for when i switch to sh nothing of this happens.
Does anybody have any clue why does BASH behave like this? it is a fresh install by the way, haven't changed any parameters or settings.
This might happen when you type an invalid command sequence with an accidental & in it. & has a special meaning to the shell, telling it to run the command in the background. An & in a weird place will cause it to try to put part of the command into background execution, and run everything after the & separately, causing something that looks very strange. I sometimes cause that when I forget to quote a URL.
Note that the prompt actually does appear, immediately after 'command not found', but gets mangled afterwards by the accidentally-backgrounded wget process printing junk on top of it.
It could also be that you forgot a closing quote somewhere and it's waiting for you to finish your string.
It would be helpful to know what you actually typed, word for word, letter for letter, keystroke for keystroke.
Last edited by Corona688; 01-18-2011 at 10:59 AM..
try typing
Then echo $PS1 and $PS2 and see what the values are
You may also want to check environment variables.
Thanks alot mark54g. The reset command worked and the strange behavior is gone now. But i wonder why did that happen and the first place, and what does the reset command do?
'reset' resets your terminal characteristics to normal.
You must have run something that dumped a bunch of non-ASCII characters into the terminal. Some of which your terminal coincidentally managed to understand as escape sequences, mashing random settings in your terminal(colors, font settings, scrolling regions, etc) until it was unable to show proper output anymore.
So I'm trying to pass certain json elements as env vars and use them later on in a script.
Sample json:
JSON='{
"Element1": "file-123456",
"Element2": "Name, of, company written in, a very weird way",
"Element3": "path/to/some/file.txt",
}'
(part of the) script:
for s... (5 Replies)
Hello Experts,
I have been trying to send a test mail in our linux server with sendmail command.But I am getting command not found error message.
-->when I tried whether sendmail installed or not with the command
rpm -qa sendmail* I got the below,
sendmail-cf-8.14.4-8.el6.noarch... (26 Replies)
In the bash below, if the answer is "y" then goto function remove. If the answer is "n" then goto the id variable line (where the date is inputted). However, I am getting command remove not found, but remove is a function not an command. I must have the syntax incorrect? Thank you :).
... (3 Replies)
Good Morning
I think there may be something I dont understand fully.
The following code works well, but I dont like the set domen method.
#!/bin/bash
#
domen="y"
while
do
echo " M A I N - M E N U"
echo "1. Contents of /etc/passwd"
echo "2. List of users currently logged"
echo... (10 Replies)
I created a script that I need to run from time to time, but get this error message. To get it working again I run this command from time to time:
export PATH="$PATH:~/scripts"
I put all my automated scripts in the /scripts directory and would like to run my scripts from any directory... (5 Replies)
I downloaded and installed "Cygwin yesterday onto my PC running Windows XP. When I tried to type "vi" in Cygwin's window, I got the following message bash: vi: Command not found
What shud i do inorder to get into vi editor
Thanks (10 Replies)
Hi All,
Linux lxs3er06 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux
Issue:
While executing shell scripts in bash shell, following error messages are thrown:
rm:command not found
On doing little investigation, I added '/bin' to $PATH and on doing echo... (9 Replies)
I am trying to create a shell that asks the user to enter their name, and compare it to my own by saying we have the same name or saying my name and that they have a nice name too. Here is my script...
#!/bin/bash-x
echo "Enter your name".
read name
if
then
echo "My name is Adam too"... (1 Reply)
i am having a weird error on mac os x running some shell scripts. i am a complete newbie at this and this question concerns 2 scripts. one of which a friend of mine wrote (videochecker.sh) a couple weeks ago and it's been running fine on another machine.
then last week i wrote capture.sh and it... (2 Replies)
Hello All,
I have installed Cygwin on Windows XP and working with some Shell scripting work, I have needed to schedule my script using the cornetab and whatever commands such as "cron", "cron-config" are not working in my cygwin shell,
I re-installed the Cygwin but the same problem is with... (2 Replies)