vkaul11
vkaul11

Reputation: 4214

Sending mail with bash argument from command line in subject

I have the following code and I wanted the argument -s too to use the first argument of my bash script. How do I ensure it happens as it prints $1 straight for the subject, though the message body has $1 interpreted correctly as it goes through the echo statement.

echo "Converse Log Labels $1" | mailx -a conversation_logs_"$1".tsv -s "Converse Logs Labels Data "$1"" [email protected]

Upvotes: 0

Views: 325

Answers (1)

Cyrus
Cyrus

Reputation: 88776

echo "Converse Log Labels $1" | mailx -a "conversation_logs_$1.tsv" -s "Converse Logs Labels Data $1" [email protected]

Upvotes: 2

Related Questions