I'm trying to create a shell script using my, very basic, shell scripting skills.
I work at a Mac Lab that has different sections of computers with different types of software in each section. I'm trying to write a shell script that will take arguments, search either a seperate file or just already set arrays in the script, and then spit out an answer based on the given arguments.
I have my arrays set up in a file so far in the form of section='SoftwareA SoftwareB SoftwareC etc...' and I can grab arguments, but I'm starting to get stuck now. I don't know how to take the arguments and search each array. What I have so far is here:
Code:
#!/bin/bash
#set -A args $*
# Script to find software
section1=(SoftwareA SoftwareB SoftwareC SoftwareD SoftwareE)
section2=(SoftwareA SoftwareC SoftwareD SoftwareE)
section3=(SoftwareA SoftwareB SoftwareE)
section4=(SoftwareA SoftwareB SoftwareC SoftwareD)
*edit, I apparently can do arrays through bash, I thought you couldn't. So I changed to bash.