10-08-2009
KSH if statement
Hi guys,
im new to UNIX so bear with me.
would it be possible for me to create an if statement where i can have a key being entered and something happening after that. (bad explanation)
eg. If user enters letter 'q' then
close window or exit puTTy
Thanks in advance
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
what is the problem with this comparison in ksh script:
if " ]
it gives syntx error (3 Replies)
Discussion started by: gfhgfnhhn
3 Replies
2. UNIX for Dummies Questions & Answers
I have:
datafile contains 1234567890
>wc -c datafile | awk '{print $1}'
>11
The program
#!/bin/ksh
let n = (wc -c datafile | awk '{print $1}')
echo $n
I expect n to be 11 but it gives error message. What is wrong with this statement?
Thanks! (3 Replies)
Discussion started by: bobo
3 Replies
3. Shell Programming and Scripting
I need a way to grep for a string in a file and if it finds it, to print set a variable to "Yes", if it doesn't find the string in a file to set the variable to "No". I plan on using these variables to print a table that lists whether the string was found or not.
For example
print "File ... (2 Replies)
Discussion started by: stepnkev
2 Replies
4. UNIX for Dummies Questions & Answers
I'm trying to figure out why this if statement won't work:
if || $zipcount != 6 ]]
then
echo ${myline}
echo "ZIPCODE WARNING! ${zipcode} ${zipcount}"
fi
if ]]
then
echo ${myline}
echo "STATE WARNING!... (3 Replies)
Discussion started by: developncode
3 Replies
5. Shell Programming and Scripting
Hi,
I need to compare two variables using if condition and i am not sure if am right or wrong. My code is like :
if
then
echo "new file"
else
echo "old file and remove it"
fi
where both variables contain time : filetime contains the time when a file... (2 Replies)
Discussion started by: manmeet
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
My script should run through all subdirs recursively in SUBDIR_LIST, run a clearcase command in each subdir, print to the merge_results1.txt and add a new line to the results before going to the next subdir. All the results should append to merge_results1.txt, but are seperated by a line so... (8 Replies)
Discussion started by: asulli01
8 Replies
7. Shell Programming and Scripting
I am trying to write a ksh script using the case statement to select certain directories to remove. The directories that I am looking for are in the following format 2008-10-10. I want to exclude all other files/directories that contain anything other the 4 digit year,a dash, 2 digit month, a... (2 Replies)
Discussion started by: dgilc
2 Replies
8. Shell Programming and Scripting
#! /bin/ksh
rm -f ./xyz file --- this line is working
// Below any if stmt is not working.
if
then
echo " blah blah "
fi
or I replaced above if with
if
then
echo "dir exists"
fi
This is also not working.
I am new to KSH. So can someone help why if stmt is not... (31 Replies)
Discussion started by: saggy9583
31 Replies
9. Shell Programming and Scripting
How can I search get if to pinpoint 1 word in a line and have it do something for me?
example:
KEY1="<< Response ... Total of 2 >> Sun Jun 19 15:30:18 2011 Tx Power Level is 27.7 Bm ~ "
if ];
then command;
else error;
fi
Thats just a quick sample. I want my if statement to se the... (5 Replies)
Discussion started by: 82280zx
5 Replies
10. Shell Programming and Scripting
Hi
I tried the below code where it is working properly
#!/bin/ksh
set -x
date1_data=abc.txt
date2_data=bcd.txt
if diff $date1_data $date2_data >/dev/null ; then
echo "Equal"
else
echo "Not Equal"
fi
Then I tried like below where i want to use only if fi not else part
... (3 Replies)
Discussion started by: smile689
3 Replies
LEARN ABOUT HPUX
rndc.conf
rndc.conf(4) Kernel Interfaces Manual rndc.conf(4)
NAME
rndc.conf - rndc configuration file
DESCRIPTION
is the configuration file for the BIND 9 name server control utility. This file has a structure and syntax similar to the configuration
file,
The standard (default) configuration file is located at The standard (default) configuration file is located at
Syntax
The syntax of the file is much simpler than that of the configuration file. It includes three statements and optional comments. Statement
blocks are enclosed in braces and terminated with a semicolon. Clauses in the statements are also semicolon-terminated.
A servername or keyname must be quoted using double quotes if it matches a keyword, such as having a key named .
The options Statement
The statement specifies the default server and key definition for the configuration.
The clause specifies the default server on which runs, if the server is not specified with the option in the command. defserver is the
name or IP address of a name server that is specified in a statement.
The clause specifies the default key that will authenticate the server's commands and responses if a key is not specified with the option
in the command. defkey is the name of a key that is specified in a statement.
The server Statement
The statement specifies the servername of a name server, as a host name or an IP address.
The clause specifies a keyname that matches a keyname in a statement.
Multiple statements are permitted.
The key Statement
The statement specifies the name, keyname, and definition of a key.
The clause identifies the encryption algorithm, algoname. Currently only is supported.
The clause contains the random key, secretvalue, that will be used for authentication. It is base-64-encoded, using the algorithm speci-
fied in the clause. secretvalue is enclosed in double quotes.
The BIND 9 program can be used to generate the secretvalue.
Multiple statements are permitted.
Comments
The following comment styles are supported:
C:
C++:
UNIX:
Name Server Configuration
The name server must be configured to accept connections and to recognize the key specified in the file, using the statement in
WARNINGS
Currently, there is no way to specify the port on which must run.
EXAMPLES
Example 1
Here is a sample file:
In this example, will, by default, use the server at (127.0.0.1) and the key named Commands directed to the server will use the key. The
statement indicates that uses the HMAC-MD5 algorithm and its clause contains the base-64 encoding of the HMAC-MD5 secret enclosed in double
quotes.
Example 2
To generate a random secretvalue with the command (see rndc-confgen(1)):
A complete file, including the randomly generated key, is written to standard output. Commented-out and statements for are also written.
Example 3
To generate the secretvalue with the command (see dnssec-keygen(1)):
The base-64 secretvalue will appear in two files, and After you copy the secretvalue into statements in the and files, you can delete the
and files.
AUTHOR
was developed by the Internet Systems Consortium (ISC).
SEE ALSO
dnssec-keygen(1), rndc(1), rndc-confgen(1), named(1M).
available online at
available from the Internet Systems Consortium at
BIND 9.3 rndc.conf(4)