I am trying to write a awk script that prompts user for input to set the FILENAME varable. I can get it set, but I think awk is not doing anything with it.
Using the following I'm trying to print the user's response to the prompt Y / N but I get nothing other than the contents of $1?
awk '{
printf($1 " ? (Y/N)")
getline myresponse < "-"
system("read myresponse")
if (myresponse == "Y")
{ print $1... (17 Replies)
Hi Jim,
I have following script,i which i need to take dynamic value .
script,
nawk -v v1=grep"INT_EUR" $propertifilename | cut -d"=" -F2` -F'~' '{if (NF-1 !=v1)
{print "Error in " $0 " at line number "NR" tilde count " N-1}}' $filename
In the above script i want to use INT_EUR as a variable... (2 Replies)
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)
this section of the awk code i have here takes file to work with from the user.
the user specifies the file name from the command line and the file name is assigned to the variable $FLIST
awk 'BEGIN {
while((getline < "'${FLIST}'")>0)
S
FS="\n"; RS="}\n"
}
now, i dont want... (5 Replies)
HI,
MY question is a very simple one:
if i want to call an awk script with the input file name and also pass a variable value , then how to do it.
#>awk -f my_script.awk -v variable=value my_inputfile.txt
I can't do it like this.
throws error:
awk: my_script.awk:18:... (0 Replies)
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)
I have a process that requires me to read data from huge log files and find the most recent entry on a per-user basis. The number of users may fluctuate wildly month to month, so I can't code for it with names or a set number of variables to capture the data, and the files are large so I don't... (7 Replies)
I have files named with different prefixes. From each I want to extract the first line containing a specific string, and then print that line along with the prefix.
I've tried to do this with a while loop, but instead of printing the prefix I print the first line of the file twice.
Files:... (3 Replies)
HOBBIT-NKEDIT.CGI(1) General Commands Manual HOBBIT-NKEDIT.CGI(1)NAME
hobbit-nkedit.cgi - Xymon Critical Systems view CGI
SYNOPSIS
hobbit-nkedit.cgi
DESCRIPTION
hobbit-nkedit.cgi is invoked as a CGI script via the hobbit-nkedit.sh CGI wrapper.
hobbit-nkedit.cgi is a web-based editor for the hobbit-nkview.cfg(5) file, which is used to configure the Xymon "Critical Systems" view.
A detailed description of how to use the editor is provided in the Xymon Web documentation, available from the "Help" -> "Critical Systems"
link on the Xymon website.
SECURITY
Access to this CGI script should be restricted through access controls in your webserver. Editing the Critical Systems View configuration
will impact the monitoring of your site.
OPTIONS --config=FILENAME
Name of the Critical Systems View configuration file. The default is hobbit-nkview.cfg in the $BBHOME/etc/ directory.
--env=FILENAME
Loads the environment defined in FILENAME before executing the CGI script.
--area=NAME
Load environment variables for a specific area. NB: if used, this option must appear before any --env=FILENAME option.
--debug
Enables debugging output.
SEE ALSO hobbit-nkview.cgi(1), xymon(7)Xymon Version 4.2.3: 4 Feb 2009 HOBBIT-NKEDIT.CGI(1)