Need to fetch only the required partWhy does my shell script choke on whitespace or other special...
What is the hottest thing in the universe?
Is it OK to draw different current from L1 and L2 on NEMA 14-50?
Attacking the Hydra
Graphs for which a calculus student can reasonably compute the arclength
What is a "soap"?
Dogfights in outer space
graphs in latex
How can I find files in directories listed in a file?
Is it really Security Misconfiguration to show a version number?
How was the murder committed?
Weird resistor with dots around it
What would it take to get a message to another star?
What should we do with manuals from the 80s?
Why aren't rockets built with truss structures inside their fuel & oxidizer tanks to increase structural strength?
Help, I cannot decide when to start the story
Locked Room Murder!! How and who?
How to gracefully leave a company you helped start?
How can I shoot a bow using strength instead of dexterity?
"Mouth-breathing" as slang for stupidity
Co-workers with a lot of money and openly talk about it
Lípínguapua dopo Pêpê
Is there a way to proportionalize fixed costs in a MILP?
What is the prop for Thor's hammer made of?
Boss wants me to ignore a software API license
Need to fetch only the required part
Why does my shell script choke on whitespace or other special characters?Remove comma between the quotes only in a comma delimited fileExtend grep to find a match after the first matchSED command to format text fileHelp in manipulating a test fileSelective extraction of dataNeed commands to grep Unknown number of lines before after locating the search String in the filesThe differences between sed #, %, / and |egrep with while loop shell script
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
We have a string as below:
**XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."**
We need to fetch only the below string into a variable:
This is the subject for the mail
Similarly, need to fetch only the below string into other variable:
PFA for the list of Invoices that are stuck in workflow.
These are not always the same. the strings may vary based on what user entered.
Can anyone please help me on how to fetch only those strings using UNIX commands
Regards,
Bommi
shell sed grep cut
add a comment |
We have a string as below:
**XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."**
We need to fetch only the below string into a variable:
This is the subject for the mail
Similarly, need to fetch only the below string into other variable:
PFA for the list of Invoices that are stuck in workflow.
These are not always the same. the strings may vary based on what user entered.
Can anyone please help me on how to fetch only those strings using UNIX commands
Regards,
Bommi
shell sed grep cut
is the format consistent across all data?
– jsotola
23 hours ago
format is consistent. But, some times it is like This is the subject for the mail, sometimes it may like This is the subject for the mail. With more subject and sometimes it is just NULL value
– Bommi
23 hours ago
1
To make things more readable, I'd suggest you to format as code any text that has to be fed as input/matched literally/read by a program. It will help avoiding ambiguities, e.g. are flanking**
part of the original string?
– fra-san
22 hours ago
Use e.g.sed(1)
to isolate the required substring.
– vonbrand
15 hours ago
add a comment |
We have a string as below:
**XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."**
We need to fetch only the below string into a variable:
This is the subject for the mail
Similarly, need to fetch only the below string into other variable:
PFA for the list of Invoices that are stuck in workflow.
These are not always the same. the strings may vary based on what user entered.
Can anyone please help me on how to fetch only those strings using UNIX commands
Regards,
Bommi
shell sed grep cut
We have a string as below:
**XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."**
We need to fetch only the below string into a variable:
This is the subject for the mail
Similarly, need to fetch only the below string into other variable:
PFA for the list of Invoices that are stuck in workflow.
These are not always the same. the strings may vary based on what user entered.
Can anyone please help me on how to fetch only those strings using UNIX commands
Regards,
Bommi
shell sed grep cut
shell sed grep cut
edited 22 hours ago
jsotola
1541 silver badge6 bronze badges
1541 silver badge6 bronze badges
asked 23 hours ago
BommiBommi
51 silver badge2 bronze badges
51 silver badge2 bronze badges
is the format consistent across all data?
– jsotola
23 hours ago
format is consistent. But, some times it is like This is the subject for the mail, sometimes it may like This is the subject for the mail. With more subject and sometimes it is just NULL value
– Bommi
23 hours ago
1
To make things more readable, I'd suggest you to format as code any text that has to be fed as input/matched literally/read by a program. It will help avoiding ambiguities, e.g. are flanking**
part of the original string?
– fra-san
22 hours ago
Use e.g.sed(1)
to isolate the required substring.
– vonbrand
15 hours ago
add a comment |
is the format consistent across all data?
– jsotola
23 hours ago
format is consistent. But, some times it is like This is the subject for the mail, sometimes it may like This is the subject for the mail. With more subject and sometimes it is just NULL value
– Bommi
23 hours ago
1
To make things more readable, I'd suggest you to format as code any text that has to be fed as input/matched literally/read by a program. It will help avoiding ambiguities, e.g. are flanking**
part of the original string?
– fra-san
22 hours ago
Use e.g.sed(1)
to isolate the required substring.
– vonbrand
15 hours ago
is the format consistent across all data?
– jsotola
23 hours ago
is the format consistent across all data?
– jsotola
23 hours ago
format is consistent. But, some times it is like This is the subject for the mail, sometimes it may like This is the subject for the mail. With more subject and sometimes it is just NULL value
– Bommi
23 hours ago
format is consistent. But, some times it is like This is the subject for the mail, sometimes it may like This is the subject for the mail. With more subject and sometimes it is just NULL value
– Bommi
23 hours ago
1
1
To make things more readable, I'd suggest you to format as code any text that has to be fed as input/matched literally/read by a program. It will help avoiding ambiguities, e.g. are flanking
**
part of the original string?– fra-san
22 hours ago
To make things more readable, I'd suggest you to format as code any text that has to be fed as input/matched literally/read by a program. It will help avoiding ambiguities, e.g. are flanking
**
part of the original string?– fra-san
22 hours ago
Use e.g.
sed(1)
to isolate the required substring.– vonbrand
15 hours ago
Use e.g.
sed(1)
to isolate the required substring.– vonbrand
15 hours ago
add a comment |
1 Answer
1
active
oldest
votes
If you sure about number and order of fields and quotes in them, then you could use cut -d"
to get required fields like this:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f14 -d"
This is the subject for the mail
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f16 -d"
PFA for the list of Invoices that are stuck in workflow.
Or may be even better to use awk
if you need to get last two fields:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| awk -F" '{ print $(NF-3) }'
This is the subject for the mail
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
1
@Bommi If you runmailx -s$FCP_SUBJECT
, the variableFCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to-s
. Pay attention to quoting your variables.
– fra-san
22 hours ago
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535493%2fneed-to-fetch-only-the-required-part%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you sure about number and order of fields and quotes in them, then you could use cut -d"
to get required fields like this:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f14 -d"
This is the subject for the mail
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f16 -d"
PFA for the list of Invoices that are stuck in workflow.
Or may be even better to use awk
if you need to get last two fields:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| awk -F" '{ print $(NF-3) }'
This is the subject for the mail
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
1
@Bommi If you runmailx -s$FCP_SUBJECT
, the variableFCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to-s
. Pay attention to quoting your variables.
– fra-san
22 hours ago
add a comment |
If you sure about number and order of fields and quotes in them, then you could use cut -d"
to get required fields like this:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f14 -d"
This is the subject for the mail
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f16 -d"
PFA for the list of Invoices that are stuck in workflow.
Or may be even better to use awk
if you need to get last two fields:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| awk -F" '{ print $(NF-3) }'
This is the subject for the mail
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
1
@Bommi If you runmailx -s$FCP_SUBJECT
, the variableFCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to-s
. Pay attention to quoting your variables.
– fra-san
22 hours ago
add a comment |
If you sure about number and order of fields and quotes in them, then you could use cut -d"
to get required fields like this:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f14 -d"
This is the subject for the mail
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f16 -d"
PFA for the list of Invoices that are stuck in workflow.
Or may be even better to use awk
if you need to get last two fields:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| awk -F" '{ print $(NF-3) }'
This is the subject for the mail
If you sure about number and order of fields and quotes in them, then you could use cut -d"
to get required fields like this:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f14 -d"
This is the subject for the mail
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| cut -f16 -d"
PFA for the list of Invoices that are stuck in workflow.
Or may be even better to use awk
if you need to get last two fields:
echo 'XX_EMAIL_FILES FCP_REQID=9614696 FCP_LOGIN="APPS/sup12" FCP_USERID=5667 FCP_USERNAME="SRI" FCP_PRINTER="noprint" FCP_SAVE_OUT=Y FCP_NUM_COPIES=1 "9614556_SUP12_XX_Workflow_Stuck_AP_Invoices.csv" "/tmp_mnt2/attachments" "Sri.B@xx.com" "This is the subject for the mail" "PFA for the list of Invoices that are stuck in workflow."'
| awk -F" '{ print $(NF-3) }'
This is the subject for the mail
edited 22 hours ago
answered 23 hours ago
Fedor DikarevFedor Dikarev
1,2183 silver badges10 bronze badges
1,2183 silver badges10 bronze badges
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
1
@Bommi If you runmailx -s$FCP_SUBJECT
, the variableFCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to-s
. Pay attention to quoting your variables.
– fra-san
22 hours ago
add a comment |
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
1
@Bommi If you runmailx -s$FCP_SUBJECT
, the variableFCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to-s
. Pay attention to quoting your variables.
– fra-san
22 hours ago
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
I used cut -f14 -d". It is ok. But now facing an other issue Actually, we developed host file (using UNIX) to send emails. Here, user provide the subject and body while running the programs (Oracle Concurrent Programs). After fetching the subject and body values using above commands, the values are stores in variables as below: FCP_SUBJECT as This is the subject and FCP_BODY as This is the body Now, mailing as below: * echo "Hello, ${FCP_BODY} Thanks, ${FCP_USERNAME} "| mailx -s$FCP_SUBJECT * Then, the mail subject is coming as just This
– Bommi
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
@Bommi, that is a different question from what you asked above .... post a new question
– jsotola
22 hours ago
1
1
@Bommi If you run
mailx -s$FCP_SUBJECT
, the variable FCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to -s
. Pay attention to quoting your variables.– fra-san
22 hours ago
@Bommi If you run
mailx -s$FCP_SUBJECT
, the variable FCP_SUBJECT
undergoes splitting and its first word only is used as the argument value to -s
. Pay attention to quoting your variables.– fra-san
22 hours ago
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f535493%2fneed-to-fetch-only-the-required-part%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
is the format consistent across all data?
– jsotola
23 hours ago
format is consistent. But, some times it is like This is the subject for the mail, sometimes it may like This is the subject for the mail. With more subject and sometimes it is just NULL value
– Bommi
23 hours ago
1
To make things more readable, I'd suggest you to format as code any text that has to be fed as input/matched literally/read by a program. It will help avoiding ambiguities, e.g. are flanking
**
part of the original string?– fra-san
22 hours ago
Use e.g.
sed(1)
to isolate the required substring.– vonbrand
15 hours ago