You are not logged in.
Hello all
I have took a script and made a little modifications on it, specifically, I have added the command read on it:
#!/bin/bash
USERNAME=""
PASSWORD=""
URL=http://www.gnewbook.org/api/update.php
echo -n "Join the message:"
[b]read MESSAGE[/b]
RST=$(curl -s -u $USERNAME:$PASSWORD -d status="$MESSAGE" $URL > /tmp/gNewBook_up2date.log)
IDS=$(cat /tmp/gNewBook_up2date.log | grep "</id>" | head -n1 | cut -d '>' -f2 | cut -d '<' -f1)
echo "Post on gNewBook with ID:"$IDS
exit 0
This script allows to send updates of status to the system of microbbloging on gnewbook.org, through curl.
I have added the command read and established their output like a variable named MESSAGE:
read MESSAGE
Well, if you run the script at the moment that it says:
Join the message:
You can write it but you can not use the key back or forward, becouse, the terminal prints something like ^[[C^[[C^[[C^[[C^[[D^[[D^[[D^[[D^[[D^[[D^[[D
So, I want to know if exist any way to fix it this behaviour
Thanks in advance and sorry my poor english I talk spanish
Offline
man bash
Offline
man bash
I've hardly ever found the bash manual to be very helpful since it's over 5000 lines long and when I have questions about a shell they rarely have clear, searchable keywords (such as this one).
Anyway, I found this using Google (the same question has been asked before):
-e If the standard input is coming from a terminal, readline
(see READLINE above) is used to obtain the line. Read‐
line uses the current (or default, if line editing was
not previously active) editing settings.
It produces the behavior you're looking for, zuargo. How you would have found and interpretted this to be what you're looking for is beyond me.
Offline
Procyon wrote:man bash
I've hardly ever found the bash manual to be very helpful since it's over 5000 lines long and when I have questions about a shell they rarely have clear, searchable keywords (such as this one).
Anyway, I found this using Google (the same question has been asked before):
-e If the standard input is coming from a terminal, readline (see READLINE above) is used to obtain the line. Read‐ line uses the current (or default, if line editing was not previously active) editing settings.
It produces the behavior you're looking for, zuargo. How you would have found and interpretted this to be what you're looking for is beyond me.
Thanks a lot you are very gentile
Offline