Question: I am trying to use a script to run two linux dns commands WHOIS and DIG.

So far my script is as follows:

```
#!/bin/bash
for i in $1
do      
    reg1=`whois $i`
    echo "*********WHOIS Results for $i*********"
    echo -e "[$i]\n$reg1"
    for j in 4.2.2.3 
    do
        reg=`dig any @$j $i `
        echo -e "[$j]$reg"
    done
done

```

Now I am looking for a command to replace the '4.2.2.3' that I can use to search the output of the previous command and return part of this line: 'Name Server: A.DNS.HOSTWAY.NET'. The 'Name Server:' is what I will search for and it should return the following text, stopping at the end of the line.

Answer: 
You cannot set the views directory per request with Express, which is what you're trying to do.

But you can use subdirectories in your calls to `res.render()`:

```
app.get('/admin/', function(req, res) {
  res.render('admin/index');   // renders '__dirname + /template/admin/index.ejs'
});

app.get('/', function(req, res) {
  res.render('client/index');  // renders '__dirname + /template/client/index.ejs'
});

```
you can write your own middleware for this.

Something like this:

```
var siteDir = "/client"; //default case;
app.use(function(req,res,next){
    if(req.path == '/admin') siteDir = '/admin';
    else siteDir = '/client';
    next();
});
app.engine('ejs', require('ejs-locals'));
app.set('views', __dirname + ('/template' + siteDir));
app.set('view engine', 'ejs');

```