READ variable etc

debian_updates_etc

New Member
Joined
Jun 29, 2024
Messages
3
Reaction score
0
Credits
29
Hello !

#!/bin/sh
gpg -a -r read -e message.txt
gpg -a -r interactive_choice -e message.txt



how do I create a script that lets the user type the email address of the recipient as the only thing.
 


You can simply ask the user to type the email address like this:
Code:
echo "Please enter the recipient's email address:"
read recipient_email
and then simply use $recipient_email. If you want more functionality you should be more clear on what you're trying to achieve
 
Hello !

#!/bin/sh
gpg -a -r read -e message.txt
gpg -a -r interactive_choice -e message.txt



how do I create a script that lets the user type the email address of the recipient as the only thing.
MESSAGE=$(/usr/bin/cat message.txt)

Now the contents of message.txt will be stored in the shell variable $MESSAGE.

Signed,

Matthew Campbell
 

Staff online


Top