Question: During resolution, SettingAPI will present dialog, but it contains everything that it detects the user needs to activate. For example, WIFI and GPS. I would like to prompt the user to turn on only GPS for example, but not WIFI for security reasons. If I send them to settings instead of the using Plays ,new Settings API they have the option of turning everything on. I am trying to limit to just one type of setting and I would like to use the SettingAPI dialog for this.

Answer: 
What you need is to convert the `if` statement into an argument to `bash`. Doing a simplistic transform, assuming that the code in the question has a chance of working, you get:

```
tail -f nohup.out |
xargs -I '{}' bash -c "if [[ {} == *"denied"* ]]; then dig -x $(cut -d '-' -f 6 {} | cut -d ':' -f 1) & fi"

```

This is exactly the same basic treatment as was needed for a `for` loop being executed by `nohup` — you need a shell to run the built-in command. See [Why can't I use Unix `nohup` with Bash `for` loop?](https://stackoverflow.com/questions/3099092/) for an exactly analogous situation.

However, on further reflection, you want to cut the string which is the IP address, not the file with that as a name, so the command needs to echo the string into the `cut` commands. You also have to tear your hair getting the sub-commands executed correctly; you need a backslash before the `$` of `$(…)`, or before each of the back-ticks if you insist on using ``…`` notation, as well as using backslash-double-quote to protect the angle-brackets in the string.

```
tail -f nohup.out |
xargs -I '{}' bash -c "if [[ '{}' != *denied* ]]; then echo dig -x \"\$(echo '{}' | cut -d '-' -f 6 | cut -d ':' -f 1)\" & fi"

```

Now we need to debate the use of the condition and two `cut` commands (and the general hair loss). You could use:

```
tail -f nohup.out |
grep -v denied |
xargs -I '{}' bash -c "echo dig -x \$(echo '{}' | cut -d '-' -f 6 | cut -d ':' -f 1) &"

```

or, more sensibly:

```
tail -f nohup.out |
awk -F '[-:]' '/denied/ { next } { print "dig -x " $7 " &" }' |
sh -x

```

or any of a myriad other ways to do it.
```
awk -F- '!/denied/ {print $6}'

```

splits each input line in fields separated by `-`, ignores the lines matching `denied` and extracts the 6th field of the remaining lines. With you example it outputs:

```
216.58.209.77:443
46.28.247.89:443

```