shell scripting to send mail
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.
cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST
Sample.txt
:
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37
shell scripting
add a comment |Â
up vote
-1
down vote
favorite
Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.
cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST
Sample.txt
:
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37
shell scripting
1
As far as I can see, there is no text underEX_R02
.
â Kusalananda
Apr 10 at 6:38
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.
cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST
Sample.txt
:
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37
shell scripting
Created script and its writing in sample.txt, Unable to grep the below text "EX_R02"and need to send mail. kindly help.
cat sample.txt|mailx -a sample.txt -s "GG status Report" $MAIL_LIST
Sample.txt
:
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED EX_R02 00:00:03 01:10:37
shell scripting
edited Apr 10 at 6:38
Kusalananda
102k13200317
102k13200317
asked Apr 10 at 5:44
user3914150
33
33
1
As far as I can see, there is no text underEX_R02
.
â Kusalananda
Apr 10 at 6:38
add a comment |Â
1
As far as I can see, there is no text underEX_R02
.
â Kusalananda
Apr 10 at 6:38
1
1
As far as I can see, there is no text under
EX_R02
.â Kusalananda
Apr 10 at 6:38
As far as I can see, there is no text under
EX_R02
.â Kusalananda
Apr 10 at 6:38
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
If you by "grep the below text EX_R02
" mean "grep the text below for EX_R02
", then you may simply replace your cat
with grep "EX_R02"
:
grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
If you by "grep the below text EX_R02
" mean "grep the text below for EX_R02
", then you may simply replace your cat
with grep "EX_R02"
:
grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"
add a comment |Â
up vote
0
down vote
accepted
If you by "grep the below text EX_R02
" mean "grep the text below for EX_R02
", then you may simply replace your cat
with grep "EX_R02"
:
grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
If you by "grep the below text EX_R02
" mean "grep the text below for EX_R02
", then you may simply replace your cat
with grep "EX_R02"
:
grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"
If you by "grep the below text EX_R02
" mean "grep the text below for EX_R02
", then you may simply replace your cat
with grep "EX_R02"
:
grep "EX_R02" sample.txt | mailx -a sample.txt -s 'GG status Report' "$MAIL_LIST"
answered Apr 10 at 6:40
Kusalananda
102k13200317
102k13200317
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f436687%2fshell-scripting-to-send-mail%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
As far as I can see, there is no text under
EX_R02
.â Kusalananda
Apr 10 at 6:38