executing commands in invisible mode
Hi,
i just want to know whether we can execute the commands in invisible mode in linux. i.e.the command we typed must be executed but should not be visible.is it possible. if not,then how the password we are typing is not visible in linux,while creating or entering password for users. thanks in advance, Dinesh. |
For what purpose do you want to have a non-echoing command line? It seems to me like it would be rather awkward to use. And while there are obviously ways to keep text from being echoed to output, I don't think it's something that can be enabled generally in most shells. I could be wrong though.
But if you really want a way to launch a command without it being visible, one quick and dirty solution I thought of is a simple function using the "-s" silent option of bash's "read" built-in. Code:
function scom() { Note though that there are limitations to this. Few of the regular bash features will be available. There's no tab-completion or command history available, for example. Notice also that this won't affect the output of the commands either. Any cli output or error messages will still appear usual, although you could add "&>/dev/null" to the end of the launching line to dispose of that as well. Finally, you can add the function name to your HISTIGNORE environment variable so that it won't be stored in the command history, if you want to hide even that. |
Quote:
have you tried Code:
stty -echo |
centosboy
Thanks !! That worked great ! Now kindly tell me how to revert it back to normal ???? |
Moved: This thread is more suitable right here and was moved accordingly to help your thread/question get the exposure it deserves.
|
I don't know if this helps:
Code:
command &> /dev/null & |
The two ways to do this were stated above. First option is to send all standard output and error to /dev/null. The second would be to disable character echo in the shell. This is done by running "stty -echo". Both of these were stated above by MTK358 and centosboy.
|
Quote:
|
Hi,
Thank you very much, it works ,but is reboot the only option to recover from this mode or we have any other special command for this. thanks&advance, Dinesh. |
How many of the responses above did you actually READ?
|
devnull10
Thanks for the response :) |
Hi,
Thank you very much.yes this looks great. |
this is cooooooooooooollll...i liked this very much....
thanks to centosboy and devnull |
All times are GMT -5. The time now is 02:27 AM. |