Anyone has a bash or awk one-liner to parse the output of this command?

```
# whereis java
java: /usr/bin/java /usr/local/openjdk-8/bin/java

```

so it returns, in this case, the path `/usr/local/openjdk-8`? IOW, what is `some_script`?

```
# whereis java | some_script
/usr/local/openjdk-8

```

I know at least to do this, but now to just get `/usr/local/openjdk-8`

```
# whereis java | awk '{print($3)}'
/usr/local/openjdk-8/bin/java

```

**Update/edit per Charles Duffy's suggestion**

Using this command

```
# type -P -a java
/usr/local/openjdk-8/bin/java

```

How can I pipe it to get this? IOW, what is `some_script`?

```
# type -P -a java | some_script
/usr/local/openjdk-8

```