With the following bash shell script, when I enter password, it won't be printed in the screen.
But, I would like Asterisk character to be printed instead of the real characters. Any idea how ?
I think that the -p flag of read takes the next item as a prompt, so you might have:-
To display one * for every key press will be more tricky. You would need to read the input 1 character at a time and display the *, building up your overall password variable as you go. No doubt you would also want to handle mistakes in the input, so you would have to allow a backspace character and both delete an * from the screen (making sure that you don't start deleting the prompt) but also remove the last character from the variable you are building up.
Is it really worth this much effort? A telnet or ssh login prompt does not go to these lengths, and it's of limited value to the user anyway.
Those horrible project management phrases are clanging in my head - cost justification; business need; supportability; ..........
I have to print the number of stars that increases on each line from the minimum number until it reaches the maximum number, and then decreases until it goes back to the minimum number. After printing out the lines of stars, it should also print the total number of stars printed.
I have tried... (13 Replies)
I want to give my long scripts to customer. The customer must not be able to read the scripts even if he has the password. The following command locks and unlocks the script but the set +x is simply ignored.
The code:
read -p 'Script: ' S && C=$S.crypt H='eval "$((dd if=$0 bs=1 skip=//|gpg... (7 Replies)
So, here's the deal... I was attempting to type this:
> grep -R "searchterm" *
and somehow I typed this instead:
> grep -R "searchterm"
> *
I accidentally typed "space-asterisk" on the second prompt. This apparently caused Bash to attempt to run the first file in the pwd, which... (1 Reply)
Hello,
I am trying to save in a file a single "*" but its not working... look what i am doing...
FILE="/home/teste/a.txt"
...BEGIN...
ASTERISK="*"
echo "STRING $ASTERISK STRING" >> $FILE
...END...
when i do it, the result is a list of all files of the current... (4 Replies)
I have three cron entries in a file /cron_entries as
15 * * * * /bin/hourjobs > /tmp/hrjob.log 2>&1
..................
....................
I am trying to read this file in for loop using code below:
cron=`cat /cron_entries`
for line in $cron
do
printf... (4 Replies)