Adding a new flag to a bash script
Author Message
Posted : Mon, 29 September 2008 21:47:49
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.
Khabi
Posted : Tue, 30 September 2008 01:44:00
Subject : Adding a new flag to a bash script
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
Banker
Posted : Tue, 30 September 2008 03:36:27
Subject : Adding a new flag to a bash script
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!
Banker
Posted : Tue, 30 September 2008 22:25:50
Subject : Re: Adding a new flag to a bash script
BTW the grep -v suggestion doesnt work