Category Archives: scripting

Scripting class, answers 1

1. In firefox, right click on an image and do Copy link location. Then use that link in your script. {1..21} is shorthand for the space separated list from 1 to 21, i.e.: “1 2 3 4 5 6 7 … Continue reading

Posted in answers, scripting | Leave a comment

Scripting class questions 1

Loops 1. using wget or curl, and a for loop, download all of the following images: 2. using a loop, backticks (`) and the basename command, rename all of the images, adding “(modified)” to their filenames 3. using a loop, … Continue reading

Posted in questions, scripting | Leave a comment

Bash Guide for Beginners, chapter 4 solutions

Solutions to: http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_05.html 1. grep bash /etc/passwd | cut -d: -f1grep bash /etc/passwd | cut -d: -f1 2. grep "^daemon" /etc/groupgrep "^daemon" /etc/group 3. grep –invert-match "^daemon" /etc/groupgrep –invert-match "^daemon" /etc/group 4. info with line numbers: grep -n localhost /etc/hostsgrep … Continue reading

Posted in answers, scripting | 3 Comments