Updated as original was unclear.  I'm setting up postfix on a computer to work with my email's SMTP.  I don't want to enter my credentials in plain text, especially when typing in public.  Is it possible to make bash not show my input for a command or two?  Example: I'm entering a series of commands and then I want to echo a username and password into a config file.  I'd like to quickly go into a mode where my input isn't shown on screen, then easily leave that mode with ctl+c.
123099
When I want to ask for a password in a bash script, I do that :  read -s   ...but when I run bash in POSIX mode, with sh, the -s option is rejected:  $ read -s sh: 1: read: Illegal option -s   How do I securely ask for an input with a POSIX-compliant command ?
86330
I've noticed a significant issue with the \input command, it seems.  For some reason, I can't seem to prevent it from adding a space after it reads its input.  Even if there is no newlines or spaces at the end of the file, LaTeX seems to be just driven to add a space.  Minimal working example is this:  \documentclass{article} \begin{document} A\input{TestInput.out}B \end{document}   Where TestInput.out contains only the text "SomeText" and no special characters  This provides the output:  ASomeText B   Does anybody know how to prevent this?  For a typesetting program, it's kind of weird to just arbitrarily add spaces IMO.  I'd like to think there's an easy fix, but I'll take any portable, robust fix if it works.
101780
Is there a standard (POSIX) way of asking the user some data from within a shell script, with  for example, while allowing live edition of the text being typed (what readline does)?   I know bash has read -e varname that allows for the person launching the script to use keyboard arrows for exemple, to edit or correct what has just been typed without deleting the last entered characters with backspace.   However, read -e is . And still, it is pretty cumbersome to delete all that has been wrote if you realise you made a mistake at the beginning of your long sentence...
105273
How can I perform two commands on one input, without typing that input twice?  For example, the stat command tells a lot about a file, but doesn't indicate its file type:  stat fileName   The file command, tells what type a file is:  file fileName   You can perform this in one line this way:  stat fileName ; file fileName   However, you have to type the fileName twice.  How can you execute both commands on the same input (without typing the input or a variable of the input twice)?  In Linux, I know how to pipe outputs, but how do you pipe inputs?
68999
Rather than rephrasing my question, let me describe to you the desired user-case:  I create a short shell-script to run command "gnome-terminal --someoptionflagname 'my text to be posted'", and execute this script.  Gnome-terminal pops up, with command-line prompt followed by my text.   ie: fields@mycomputer:/$ my text to be posted  Can this be done?
60857
I just ran across a screenshot of someone's terminal:    Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right arrow?
64994
file contains just 1 line:  aaa   when I run "cat file" it mixes to username  user /dir : cat file aaauser /dir :   What could be the problem ?  Extra Info:  perhaps this is not properly set in bashrc ? ?  PS1='\u \W : '   UPDATE:  shouldnt there be a solution other than including a newline to the file ?  Why would there be no care for the elements that can distort the command line prompt ? ( by not having a new line )
104062
Below is an image of the process I took to create a user on bash in Linux.    I understand that the password shouldn't be displayed for security purposes, but what I mean is, why do asterisks (or the characters I entered) not appear?
99211
I am doing some challenges. This is one them. I am trying to brute-force 4 digit pin with the password to get my desired answer. After connecting to the port It prompts me to enter the password then space then 4 digit pin. I tried to brute-force the pin using the script:  #!/bin/bash   nc localhost 30002   sleep 2    for i in {0000..9999};       if [[ $(echo 'UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i' &lt;/dev/stdin) = ^Wrong*]];                         then          continue       echo '[+] Pincode Cracked! Pincode = $i'       fi   done  but it seems that this doesn't input the pass and pin to stdin, before i tried doing something like this -&gt; if [[ $(echo 'UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i') = ^Wrong* ]]; What am I doing wrong here? UPDATE: Okay, so after researching around. I wrote this: for i in {0000..9999} do     if [ (echo &quot;UoMYTrfrBFHyQXmg6gzctqAwOmw1IohZ $i&quot; | nc localhost 30002 | grep -o Wrong) == &quot;Wrong&quot; ]    then       sleep 0.1       continue    fi    echo &quot;- - - - - - - - - - - - - - - - - - - - - - - - [$i]&quot; done  This might even work but as you can see it opens new connections in the loop which makes it really slow and exhaust the system.
11355
I'm writing a C Shell program that will be doing su or sudo or ssh. They all want their passwords in console input (the TTY) rather than stdin or the command line.  Does anybody know a solution?  Setting up password-less sudo is not an option.   could be an option, but it's not present on my stripped-down system.
27978
Let's say, I have the following bash script:  #!/bin/bash sudo command1 command2 sudo command3   I don't want to run command2 as root, so I won't run the script itself with sudo. Therefore, as soon as I execute the script, sudo command1 asks for my password. Unfortunately, command2 takes about 2 hours to complete. So the sudo credentials timestamp timed out and when the script reaches sudo command3, I'm prompted for the password again.  I don't want to permanently disable the sudo credentials timestamp timeout altogether as described in  for example. I just want to disable the timeout temporarily, effectively keep the credentials for this one bash session until it ends.
95791
Is there some way I can run a Bash script as root without being prompted for a password every time? I'm attempting to automate the process of starting my LAMPP install, which requires me running a couple of sudo commands to start and stop services. Optimally, I'd like to build this into an executable file, so all I'd have to do is click an icon. ;)  Obviously, I have the password, so that's not an issue. I just want to take my laziness one step farther and not have to enter it every time I start my localhost. After all, that's what programming is all about, right?
18205
If I run:  sudo apt-get --yes install postfix    or  sudo bash -c 'yes | apt-get --yes install postfix'   an interactive prompt appears to configure postfix. I need to automate the installation of postfix (I can modify the configuration files after the install).  Is there some magic that lets me install postfix (and other package) without human intervention?
90559
Is there a way to temporarily suspend history tracking in bash, so as to enter a sort of "incognito" mode? I'm entering stuff into my terminal that I don't want recorded, sensitive financial info.
77998
This is the first time it has happened to me where I am using the su command and it actually displays the password on the terminal and doesn't stay hidden. Here is my code snippet:   sshpass -p "password" ssh -q username@74.11.11.11 "su -lc 'mkdir temp/'"   Code explanation:  I am accessing a remote server and trying be root on that server to create a folder. In doing so I have to use the su command and it prompts me for the password. When I enter the password, it gets displayed and doesn't stay hidden. How do I fix that?
43114
Whenever I'm at the console login, I press up arrow intentionally to see the previously typed commands. But I see this ^[[A.  But when I press Ctrl Alt Print Screen Scroll Lock Pause Break Page Up Page Down Win keys doesn't echo any characters.  What might be the reason behind?  Does ^[[A sort of characters imply anything?
17645
I want to configure postfix to only send mail to addresses in a whitelist. I have tried to use smtpd_recipient_restrictions in main.cf like so:  smtpd_recipient_restrictions =     reject_unauth_destination     check_recipient_access hash:/path/to/whitelist   The whitelist file is of the format  address@example.com    OK another@example.com    OK   And then translated into a hash with the postmap command.   Still, the relay is sending mail to non-whitelisted addresses. What am I missing?  Edit: I am sending this mail via the sendmail command, which apparently bypasses the smptd restrictions. Is there a way to deal with this?   Edit 2/The rest of the story: I spent quite a bit of time trying to make sendmail send via SMTP only to discover the command I was using was not sendmail, but postfix's sendmail compatibility interface which mimics functionality but can't be told to use SMTP as far as I could tell.   84104's solution worked perfectly though.