I'd separate the data from the program, putting it in a big array. If you wanted to make it even more flexible you could read data into the array from a file.
[edit] no, that doesn't work. One moment.
[re-edit] Ahah, you need "eq", not "==". I hate perl. It works now.
Last edited by Corona688; 10-14-2010 at 12:37 PM..
Reason: fixed the fix of the fixed fix. argh.
I'm trying to write a script that simplify the use of grep utility. these are the option that I'd like to use with the script " -c -i -l -n -v". When I execute the script none of these option works. I really appreciate any idea or tips regarding this problem. here the code
echo " Enter 1-7:"... (2 Replies)
Hi all,
How can I simplify following script,
Logic is to find two strings (strings are case sensitive) from a file.
if ; then
if ; then
Group=`echo $1_hostname`
fi
fi
Please help me on this.
Regards
Sudhish s. kumar (8 Replies)
Hi all
I have the following which is part of a larger interactive script for adding virtual hosts to Apache's configuration (it was built for non-technical administrators). I'm curious as to whether there is a simpler way of achieving the same thing. All it does is look into the... (3 Replies)
Hi Everyone,
Below is the script, i feel there should be more simple way to do the same output, my one works, but feel not nice. like using index i feel it is slow (image my file is very large), maybe awk can do one line code?
Please advice.
# cat 1.txt
1 a
2 b
3 cc
4 d
# cat 1.pl... (6 Replies)
Hi all,
I have a script which runs every morning which clears down a series of directories. The structures of which are;
/opt/feeds/failed/feed1
/opt/feeds/succeed/feed1
/opt/feeds/failed/feed2
/opt/feeds/succeed/feed2
/opt/feeds/failed/feed3
/opt/feeds/succeed/feed3
etc
etc
Files... (6 Replies)
We've been getting a lot of XML questions lately, and I suspect it's only going to get worse better ... Normal shell utilities just can't handle it and the "proper" solutions, do-everything perl modules or things like xmlstarlet, just make my head ache.
Started coding something tonight. What... (10 Replies)
I have a script that runs once per month. It performs a certain task ONLY if the month is January, April, July, or October.
MONTH=`date +%m`
if || || || ; then
do something
else
do a different thing
fi
Is there a neater way of doing it than my four separate "or" comparisons? That... (2 Replies)
Hi all,
I am trying to grep a file with the word grand and get all the fields.. Then replace multiple spaces with single space and then get 8 th field and add all these numbers . I am able to do it but with so amny commands which i feel can be done in a simpler way
Please let me know if... (4 Replies)
Hello,
I have some tab delimited text data,
index name chg_p chg_m
1 name,1 1 0
2 name,2 1 1
3 name,3 1 0
4 name,4 1 0
5 name,5 1 1
I need to duplicate the "index" column, call it "id" and insert it after the... (8 Replies)
greetings,
to be clear, i have a solution but i'm wondering if anyone has a cleaner way to accomplish the following:
the variable:
LSB_MCPU_HOSTS='t70c7n120 16 t70c7n121 16 t70c7n122 16 t70c7n123 16 t70c7n124 16 t70c7n125 16 t70c7n126 16 t70c7n127 16 t70c7n128 16 t70c7n129 16 t70c7n130 16... (2 Replies)
Discussion started by: crimso
2 Replies
LEARN ABOUT NETBSD
set_form_init
FORMS(3) BSD Library Functions Manual FORMS(3)NAME
field_init, field_term, form_init, form_term, set_field_init, set_field_term, set_form_init, set_form_term -- form library
LIBRARY
Curses Form Library (libform, -lform)
SYNOPSIS
#include <form.h>
void (*)(FORM *)
field_init(FORM *form);
void (*)(FORM *)
field_term(FORM *form);
void (*)(FORM *)
form_init(FORM *form);
void (*)(FORM *)
form_term(FORM *form);
int
set_field_init(FORM *form, void (*function)(FORM *));
int
set_field_term(FORM *form, void (*function)(FORM *));
int
set_form_init(FORM *form, void (*function)(FORM *));
int
set_form_term(FORM *form, void (*function)(FORM *));
DESCRIPTION
The field_init() function returns a pointer to the function that will be called just after the current field changes and just before the form
is posted, this function may be set by using the set_field_init() function. Similarly, the function field_term() will return a pointer to
the function that will be called just before the current field changes and just after the form is unposted, this function pointer may be set
by using the set_field_term() function. The form_init() function will return a pointer to the function that will be called just before the
form is posted to the screen, this function can be set by calling the set_form_init() function. The form_term() function will return a
pointer to the function that will be called just after the form is unposted from the screen, this function may be set by using the
set_form_term() function. By default, the init and term function pointers are NULL.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
error values:
E_OK The function was successful.
SEE ALSO curses(3), forms(3)NOTES
The header <form.h> automatically includes both <curses.h> and <eti.h>.
BSD January 1, 2001 BSD