Input of char 's' is not possible anymore


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Input of char 's' is not possible anymore
# 1  
Old 12-06-2009
Input of char 's' is not possible anymore

Hello,

I have a big problem and no idea how to solve it.
I was looking up commands in /bin with 'man' as I found 'sh'.
In mistake I started the command.

Now after that I can not input the character 's' in shell anymore!

Even after restarting system the problem is still there.
Mysterious thing, because at login prompt I can input the character.

Please help me and tell how to change this back!

I hope the solution is not something like 'edit a config file (which contains character 's')' Smilie

Thanks in advance!

greetz from germany...
# 2  
Old 12-06-2009
it sounds like sh is the bourne shell.

Just type
Code:
exit

to get back to your previous environment.
# 3  
Old 12-06-2009
Thanks for your idea but it didn't solve the problem Smilie. Typing in 'exit' is doing a 'logout' and prompt for new login data.

Why can I not type this key in with the Bourne Shell Smilie?

Why did starting the command 'sh' changed my default settings Smilie, so also restarting system won't help?

What actions are done between login prompt and starting commandline interpreter? I ask because the login with password works, although there is a 's' in login data.

Sorry for my many newbie questions..

greetz

PS: Any idea how I can start 'bash' from '/bin' without the possibility to use the key 's'? Auto completition doesn't work, somehow it shows up some more files with 'ba' at start... Smilie

Last edited by daWonderer; 12-06-2009 at 05:34 PM..
# 4  
Old 12-09-2009
It is likely that your .profile file or the system /etc/profile file contains a rogue "stty" command.

For example:

This command would cause the command being typed to abort whenever you type the character "s".
Code:
stty intr 's'

This command would cause most terminals to appear to hang if you typed the character 's'.
Code:
stty stop 's'


Suggest you read these profile files with "cat" piped to "more" to find out if this is what has happened.

What is the Operating System?
Code:
uname -a

Do you have root access. If so, does the problem affect the root account as well as the user account?
Are all user accounts affected?

---------- Post updated at 16:41 ---------- Previous update was at 15:30 ----------

If there is an issue with stty, this might let you get control.

Code:
First create a variable containing octal 163 (lower case "s")
S=`echo "\0163\c"`

Then enquire of the current "stty" settings, using $S in place of lower case "s".
${S}tty -a

If something is assigned to lower case "s", we can then put the terminal settings back to something
 more normal using the "stty sane" command while we fix the issue.

${S}tty ${S}ane

Now we have a means of typing a lower case "s" we can of course type any command line command.
We still wouldn't be able to type an "s" in an editor session.


Last edited by methyl; 12-09-2009 at 12:44 PM.. Reason: layout
# 5  
Old 12-09-2009
Thanks for your answer and the interesting usage of commands.

But I have found the problem.

I have inserted a line to 'inputrc' for setting the beep length to 0.

Code:
setterm -blength 0

After deleting this line the usage of the 's' is again available.

Hmmm... Typing this command in shell sets the beep length to zero.
I don't know why it didn't work in 'inputrc'. Any hints?
# 6  
Old 12-10-2009
Because inputrc doesn't handle shell scripts, and even uses a completely different syntax. Quote from the LFS book:
Quote:
The inputrc file handles keyboard mapping for specific situations. This file is the startup file used by Readline — the input-related library — used by Bash and most other shells.
It's about telling the terminal that when you press the left arrow key, you want the cursor to move 1 character to the left.
# 7  
Old 12-10-2009
Having established that this was Linux not Unix.

Which variant of Linux was this?
What was the value of $TERM (if any) at the time the inputrc was executed?
Was the change in /etc/inputrc or ${HOME}/.inputrc ?

Last edited by methyl; 12-10-2009 at 09:28 AM.. Reason: rethink
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

Invalid conversion from char* to char

Pointers are seeming to get the best of me and I get that error in my program. Here is the code #include <stdio.h> #include <stdlib.h> #include <string.h> #define REPORTHEADING1 " Employee Pay Hours Gross Tax Net\n" #define REPORTHEADING2 " Name ... (1 Reply)
Discussion started by: Plum
1 Replies

2. Slackware

Anyone Using Slackware Anymore?

We used to use Slackware, but then moved all our servers to Ubuntu Linux. Does anyone use Slackware anymore? (8 Replies)
Discussion started by: Neo
8 Replies

3. Programming

I don't know how to replace input char with appropriate integer

Hi guys, I asked for help on programming forums and no one didn't helped me so I ask for help here. I am playing with some tasks from my book and I can't figure where did I get wrong. From the first program I get a blank screen, program won't generate 10*10 matrix. And second problem is I... (6 Replies)
Discussion started by: solaris_user
6 Replies

4. Programming

error: invalid conversion from ‘const char*’ to ‘char*’

Compiling xpp (The X Printing Panel) on SL6 (RHEL6 essentially): xpp.cxx: In constructor ‘printFiles::printFiles(int, char**, int&)’: xpp.cxx:200: error: invalid conversion from ‘const char*’ to ‘char*’ The same error with all c++ constructors - gcc 4.4.4. If anyone can throw any light on... (8 Replies)
Discussion started by: GSO
8 Replies

5. UNIX for Dummies Questions & Answers

Can't SSH as root anymore!

I've screwed something up in my sshd_config apparently, because I can't ssh with root anymore. I had disabled root login for security reasons, but then my ssh credentials with full administrative privelges stopped working. So then I reenabled root login (and reset ssh), but root now isn't... (3 Replies)
Discussion started by: cquarry
3 Replies

6. Programming

concat const char * with char *

hello everybody! i have aproblem! i dont know how to concatenate const char* with char const char *buffer; char *b; sprintf(b,"result.txt"); strcat(buffer,b); thanx in advance (4 Replies)
Discussion started by: nicos
4 Replies

7. Programming

Adding a single char to a char pointer.

Hello, I'm trying to write a method which will return the extension of a file given the file's name, e.g. test.txt should return txt. I'm using C so am limited to char pointers and arrays. Here is the code as I have it: char* getext(char *file) { char *extension; int i, j;... (5 Replies)
Discussion started by: pallak7
5 Replies

8. Shell Programming and Scripting

How to replace any char with newline char.

Hi, How to replace any character in a file with a newline character using sed .. Ex: To replace ',' with newline Input: abcd,efgh,ijkl,mnop Output: abcd efgh ijkl mnop Thnx in advance. Regards, Sasidhar (5 Replies)
Discussion started by: mightysam
5 Replies

9. UNIX for Dummies Questions & Answers

Can't login as SU anymore - SU: NO SHELL

the root shell has been changed in the file /etc/passwd, basically pointing to an incorrect directory. So now every time we login as 'su' I get the message 'su: no shell' so we can't login as superuser. Is there an easy way to rectify this? please use step by step instructions/commands - I... (4 Replies)
Discussion started by: homechoice
4 Replies
Login or Register to Ask a Question