Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

All, I am want to request all network services using:

 networksetup -listallnetworkservices

I then want to run the below command for each line in produced from the above command:

networksetup -setautoproxyurl "A LINE FROM ABOVE" http://etc...

Adiitonally, I only want to issue the setautoproxyurl command for service with "Ethernet" or "Wi-Fi" in the name

 networksetup -listallnetworkservices | while read line; do networksetup -setautoproxy $line http://etc...
share|improve this question

migrated from Oct 25 '12 at 3:54

This question came from our site for professional and enthusiast programmers.

man xargs? (read the part about -n parameter) – Kimvais Oct 24 '12 at 17:40
So far I have: networksetup -listallnetworkservices | while read line; do networksetup -setautoproxy$line etc... – user1582375 Oct 24 '12 at 17:40
for line in `networksetup -listallnetworkservices`
    networksetup -setautoproxyurl $line http://etc...
share|improve this answer
please edit your question, rather play 20 questions. Good luck. – shellter Oct 24 '12 at 17:55
This doesn't work – user1582375 Oct 24 '12 at 18:11
Can you be more specific? – ezod Oct 24 '12 at 18:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.