Adding a new flag to a bash script

Forum Index » Forums » Programming and Development
Author Message
Joined: Sep 29, 2008
Posts: 4
Other Topics
Posted Sep 29, 2008 at 9:47:49 PM
Subject: Adding a new flag to a bash script
All, Im new to bash and have try to make this work, but am hitting a wall. This script returns the results for all table spaces when the -d flag isnt used and a specific tablespace when the -d flag is used.
Back to top Profile Email Website
Khabi
Joined Apr 21, 2008
Posts: 121

Other Topics
Posted: Sep 30, 2008 1:44:00 AM
Without seeing what the normal output looks like it makes it near impossible to help you out. If it outputs everything to stdout (it looks like it does) you can do what you want by piping the output to 'grep -v' followed by what you want to exclude as a quick and dirty way to get what you want. script.sh -s SID -w 80 -c 90 | grep -v tablespace
Back to top Profile Email Website
Banker
Joined Sep 29, 2008
Posts: 4

Other Topics
Posted: Sep 30, 2008 3:36:27 AM
Normal out put would return Tablespaces OK. Is there anything i can add to the script so where i can type the following syntax command line: script.sh -s SID -w 80 -c 90 -o tablespace 1 And the output would be: Tablespace2 99% tablespace3 87% Even though tablespace1 would equal 85%. I want to be able to exclude anything designated after the new -o flag from the return. Thanks!
Back to top Profile Email Website
Banker
Joined Sep 29, 2008
Posts: 4

Other Topics
Posted: Sep 30, 2008 10:25:50 PM
BTW the grep -v suggestion doesnt work
Back to top Profile Email Website
Forum Index » Forums » Programming and Development