Sponsored Content
Top Forums Shell Programming and Scripting Kornshell gathering user input question Post 302497185 by Blogger11 on Wednesday 16th of February 2011 02:21:33 PM
Old 02-16-2011
That's not working either...
Here's just a portion of my code.
Code:
everything(){
		
		while read line; do
			temp=`perl -e '$_=shift; /^([^#]\w+) ?= ?(\w+)/; print "$1\t$2\n"' "$line"`
 			 parameter=`echo $temp | awk '{print $1}'`
 			 case "$parameter" in
	"break_poll_skip") value=`echo $temp | awk '{print $2}'`
            			   if [ $value != 1024 ]; then
           			      echo "break_poll_skip is currently not set to its recommended value of: 1024"
          			     fi;;
	"TCP.NODELAY") value=`echo $temp | awk '{print $2}'`
      	         if [ $value != yes ]; then
                 echo "TCP.NODELAY is currently not set to its recommended value of: yes"
               fi;;
	"bequeath_detach") value=`echo $temp | awk '{print $2}'`
               if [ $value != yes ]; then
                 echo "bequeath_detach is currently not set to its recommended value of: yes"
               fi;;
	NAMES.DEFAULT_DOMAIN) value=`echo $temp | awk '{print $2}'`
               if [ $value != world ]; then
                 echo "NAMES.DEFAULT_DOMAIN is currently not set to its recommended value of: world"
               fi;;
  esac
done < $ORACLE_HOME/network/admin/sqlnet.ora
}

echo "What type of node are you on?"
echo "Type db for Database. Type app for Application. Type both for both."
print -n "Node: ";read var

case $var in
both)
echo "do everything"
everything
;;
app)
echo "do app stuff"
;;
db)
echo "do db stuff"
;;
esac

---------- Post updated at 01:21 PM ---------- Previous update was at 01:20 PM ----------

It's not running this part:
Code:
while read line; do
temp=`perl -e '$_=shift; /^([^#]\w+) ?= ?(\w+)/; print "$1\t$2\n"' "$line"`
parameter=`echo $temp | awk '{print $1}'`
case "$parameter" in
"break_poll_skip") value=`echo $temp | awk '{print $2}'`
if [ $value != 1024 ]; then
echo "break_poll_skip is currently not set to its recommended value of: 1024"
fi;;
"TCP.NODELAY") value=`echo $temp | awk '{print $2}'`
if [ $value != yes ]; then
echo "TCP.NODELAY is currently not set to its recommended value of: yes"
fi;;
"bequeath_detach") value=`echo $temp | awk '{print $2}'`
if [ $value != yes ]; then
echo "bequeath_detach is currently not set to its recommended value of: yes"
fi;;
NAMES.DEFAULT_DOMAIN) value=`echo $temp | awk '{print $2}'`
if [ $value != world ]; then
echo "NAMES.DEFAULT_DOMAIN is currently not set to its recommended value of: world"
fi;;
esac
done < $ORACLE_HOME/network/admin/sqlnet.ora

and I know that works because i've tested it separately from the function.

Last edited by Blogger11; 02-16-2011 at 03:27 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Gathering info on one line

Hi all again, here is the file i am working on : GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:04 GREIMBAJ00;BAN_CAV;Loader.sh;2003/06/13;17:04:06 GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:11 GREIMBAJ00;BAN_PAK;Loader.sh;2003/06/13;17:04:18... (5 Replies)
Discussion started by: HowardIsHigh
5 Replies

2. Shell Programming and Scripting

unix question: user supplied input for 'alias'

I have a program to scan the log files and I want to pipe the output to 'less'. I want to create an alias such that following are equivalent scanlog chunky.lst = /udd/n2man/utils/scanlog chunky.lst|less where chunky is user supplied file which can change. Is this possible as an alias or... (1 Reply)
Discussion started by: ospreyeagle
1 Replies

3. Shell Programming and Scripting

A question about the newline character in KornShell scripts

Dear all, How can we know in a KornShell script reading a value from the standard input, that the entered value is the newline character? because as far as I know we cannot use \n for pattern matching. For example: #!/bin/ksh print -n "enter your value: " read VALUE if ] then ... (2 Replies)
Discussion started by: dariyoosh
2 Replies

4. Shell Programming and Scripting

Question about user input

Hello all, How can i have a user input that reads like this: echo -n "Please enter a & b:" 10 20 read a read b echo $a echo $b 10 20 right now i have divided it into two echos, like echo -n "a: " echo -n "b: " (1 Reply)
Discussion started by: rrahmegni
1 Replies

5. UNIX for Advanced & Expert Users

Gathering data using SAR

Hi everyone, I would like to ask if it is possible to gather SAR data on a specified time. let say yesterdays report, i want to get data at around 12PM and 5PM. thank you. (2 Replies)
Discussion started by: cwiggler
2 Replies

6. Shell Programming and Scripting

How to get the user input recursively until the user provides valid input

Hi, echo "Enter file name of input file list along with absolute path : " read inputFileList if then for string in `cat inputFileList` do echo $string done else echo " file does not exist" fi From the above code, if the user enters a invalid file... (1 Reply)
Discussion started by: i.srini89
1 Replies

7. Shell Programming and Scripting

Script interacts with user , based on user input it operates

i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled. #!/bin/sh echo " Enter your choice to continue y/Y OR n/N to quit " read A if then echo " user requested to continue " ##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies

8. Shell Programming and Scripting

Bash Question: HowTo Exit Script with User Input While Process is Running Mid-Loop?

Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies

9. Shell Programming and Scripting

User input and run awk using the input

I am trying to allow a user to enter in text and then store that text in a variable $gene to run in an awk command in which those values are used to run some calculations. I am getting syntax errors however, when I try. Thank you :). The awk runs great if it is a pre-defined file that is used,... (7 Replies)
Discussion started by: cmccabe
7 Replies

10. Shell Programming and Scripting

2 Loops gathering input

Greetings all, I have came up with some code, to read an input file and generate a list, here is a sample of what I am working with. The variable $USER will be inputted by the person running the utility. do folder=${line%} echo "$folder $USER done < list.txt sample of list.txt- ... (15 Replies)
Discussion started by: jeffs42885
15 Replies
Blt_TreeNodeId(3)					      BLT Library Procedures						 Blt_TreeNodeId(3)

__________________________________________________________________________________________________________________________________________________

NAME
Blt_TreeNodeId - Returns the node serial number. SYNOPSIS
#include <bltTree.h> unsigned int Blt_TreeNodeId(node) ARGUMENTS
Blt_TreeNode node (in) Node whose ID is to be returned. _________________________________________________________________ DESCRIPTION
This procedure returns the node serial number. The node serial number is useful for programs that export the tree data object to the Tcl programming level. Since node labels (and therefore pathnames) are not unique, the ID can be used to uniquely identify a node. The arguments are as follows: node The node whose serial number is returned. The serial number of the root node for example is always 0. RETURNS
The serial number of the node. Nodes are given a unique serial number when they are created. You can use the ID to later retrieve the node using Blt_TreeGetNode. EXAMPLE
The following example prints the ID of a node. printf("root ID is %s ", Blt_TreeNodeId(node)); KEYWORDS
Tcl_TreeCreateNode, Tcl_TreeDeleteNode BLT
2.4 Blt_TreeNodeId(3)
All times are GMT -4. The time now is 09:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy