This is a discussion on syntax for mail within the Shell scripting forums, part of the Development/Scripting category; Hi , I am trying to write a script , in which I want to use if else statement.I have ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Hi , I am trying to write a script , in which I want to use if else statement.I have check both the parts but to connectiing them I want to add a syntax in between. My script is as follows , kindly suggest me the correct syntax for it. if [ mailfrom = *@domain.com ] then ... .. else ... What syntax I can use here so as to complete this script mailfrom = *@domain.com. Regards Vaibhav |
| Sponsored Links | ||
|
|
|
|||
|
Your question isn't clear. But from what I understood this maybe what you're looking for
Code:
if [ $mailfrom = "domain.com" ]
then
# do something
else
# do something else
fi
Code:
mailfrom=$(echo user@domain.com | cut -d '@' -f 2) |
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|