Question: From what I understand a (Windows) term server is for connecting devices in a network as well as to serve as a VPN for giving devices around the world access to the internal network(non-privacy focused VPN like the ones you see in commercials, more like the general umbrella term for a literal Virtual Private Network). To me, it sounds like it's essentially meant to kill two birds with one stone

* Act like a proxy on the front of a network with a public IP that can be connected to from devices out side of the network. It will give internal access to the network and the ability to interact with the devices inside that only have local IPs.
* Take the place of a switch and connect the networks devices

When there are already two things that can do the terminal servers job, how is it not obsolete? Or is there more to it and I do not have a full grasp on the service a term server provides?

Answer: 
```bsh
#!/bin/bash

for aaa in {1..31} ;do
  echo $aaa$(ps --no-headers -p "$aaa" -o %cpu,%mem | tr -s ' ' ',') #>>/tmp/output.csv
done

```
One possible solution - I believe this is slightly more elegant (and importantly I tested it (briefly) to make sure it actually works.

```
#! /bin/bash

# This allows you to specify the PID you are interested in at the command prompt, as I expect hard coding is not a good idea.

if [ "$1." == "." ]
then
    echo Usage: $0 pid
    exit 1
fi

for each in {1..31}
do
    echo ${each}$(ps -p $1 --noheaders -o %cpu,%mem| tr -s ' ' ',') >> /tmp/file.name
done

```