Question: I am trying to create a macro that will enable someone to type in a file name and then an email list number that will select a specific distro list. I've combined a lot of different codes online to create this. If I were to just place an email into the ".to = " it works correctly. But I want to implement the if statement based on which list# the person would want to send the workbook too. When I run the macro it won't send anything, which I am assuming my if statement is not working correctly. Any advice? 

```
Sub Mail_workbook_Test()
    Dim OutApp As Object
    Dim OutMail As Object
    Dim Date1 As Date

    Date1 = Format(Now, "yyyy-mm-dd")
    'Date and format
    Filename = Application.InputBox("Enter File Name:", "Input Box Text", "File Name")
    'Type in File Name
    List = Application.InputBox("Enter Email List:", "Input Box Text", "List#")
    'Type in Email List
    If List = "List1" Then
    emailaddress = "email3@provider.com; email4@provider.com"
    ElseIf List = "List2" Then
    emailaddress = "email@provider.com; email2@provider.com"
    End If

    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)

    On Error Resume Next
    With OutMail
        .to = emailaddress
        .CC = ""
        .BCC = ""
        .Subject = "" + Filename + "" & " " & Date1
        .Body = "Hi Everyone," & Chr(10) & Chr(10) & "Please let me know if you get this!" & Chr(10) & Chr(10) & "Thanks!"""
        .Attachments.Add ("C:\Users\Desktop\" + Filename + ".xlsx")
        .Send   'or use .Display
    End With
    On Error GoTo 0

    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub

```

Answer: 
The sed -e commands are combined to create a single sed script. The following yields the same results (notice that -e is implied):

```
sed '
    s/1/ONE/
    s/2/TWO/
    /3/q
    s/ONE/THREE/
' input.txt

```

Or as a one liner:

```
sed 's/1/ONE/; s/2/TWO/; /3/q; s/ONE/THREE/' input.txt

```
Sed --help will tell you what -e means: 

```
 -e script, --expression=script
             add the script to the commands to be executed

```

I have used sed for years, and 99% of the time I use -e, except when I want to change the file then I used -i

Question 1: I am not sure about the flow, but to play safe I always pipe it to another sed

ex:

```
cat input.txt | sed -e 'command 1' | sed -e 'command 2'

```

Question 2: WRT default print, yes you can combine.

Default:

```
tiago@dell:~$ cat /etc/passwd | sed -e '/root/ !d'
root:x:0:0:root:/root:/bin/bash

```

Quiet:

```
tiago@dell:~$ cat /etc/passwd | sed -ne '/root/p'
root:x:0:0:root:/root:/bin/bash

```