02-03-2006
Getting errors
Thanks aigles but I'm getting errors when I execute this. Here's the script. And the errors I'm getting (btw, I'm running this on a Solaris server).
Script:
#! /bin/ksh
# find_script
awk -v Before="$1" -v After="$2" '
BEGIN {
FS = ":";
Before_Pattern = ".*" Before ".*";
After_Pattern = ":.*" After ".*";
}
/^BEGINJOB/,/^ENDJOB/ {
Memo[++Line_Count] = $0;
if ($1 ~ Before_Pattern) debug "Before match";
if ($1 ~ After_Pattern) debug "After match";
if ($1 ~ Before_Pattern && $0 ~ After_Pattern)
Print_Datas = 1;
}
/^ENDJOB/ {
if (Print_Datas) {
for (i=1; i<=Line_Count; i++)
print Memo[i];
}
Line_Count = 0;
Print_Datas = 0;
}
' input.txt
exit 0
Errors:
% find_script days tu
awk: syntax error near line 1
awk: bailing out near line 1
%
If I change this: awk -f circjobs1 -v Before="$1" -v After="$2" '
the errors are:
% find_script days tu
awk: syntax error near line 3
awk: bailing out near line 3
awk: newline in string near line 317
awk: newline in string near line 3844
awk: newline in string near line 4758
awk: newline in string near line 5411
awk: newline in string near line 5816
awk: newline in string near line 9824
awk: newline in string near line 10337
awk: newline in string near line 10517
awk: newline in string near line 11808
%
Last edited by BCarlson; 02-03-2006 at 09:21 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
Is there any command or script to search all the directories for duplicated files?
Thanks,
Abrahim (3 Replies)
Discussion started by: abk
3 Replies
2. Shell Programming and Scripting
Nice forum for noobs like me to UNIX. With that said, I need assistance.
I am trying to make a script to search files for a specific date and string within the file. Then I need the script to move the file that have the specific date and string to a directory. In the interim I have been manually... (7 Replies)
Discussion started by: I4ce
7 Replies
3. UNIX for Advanced & Expert Users
HI all,
I am trying to find files that have .cc3 file extenstion folder using this script below, but this fails as there are files in the folder and i get a message saying i have no files. Please anyone reveiw and let me know if i am missing anything.I am working on this from two days and i... (9 Replies)
Discussion started by: bsandeep_80
9 Replies
4. Shell Programming and Scripting
hi all
i have a requirement to write a script which will serach a file in a particuar location for 3 hours from the time when the script is run.if during this period the file arrives in a particular location then this will transmit the file to a other server.please help me writing the script which... (1 Reply)
Discussion started by: dr46014
1 Replies
5. Shell Programming and Scripting
I need to write a small shell script which does the following :
I have a file : root/var/log/ocmp/ocmpclient.log
This is a log file which is continuosly getting updated . I have to keep looking into this file all the time. I have to look for four keywords, "File Detected", File Sending",... (2 Replies)
Discussion started by: appu1987
2 Replies
6. Shell Programming and Scripting
Hi,
I am trying to write a script to search a log- IPaddress being the search criteria, I would ideally like the script to ask the ipaddress
Enter IP address - 244.258.27.225
And the ideal result would be for the script to get all the entries in the log file for a particular IP address,... (3 Replies)
Discussion started by: fuzion.hyd
3 Replies
7. Shell Programming and Scripting
Dear All,
I would like to create a Unix script which basically searches for files which are more than 2 days old and copy only the new files to the destination. What i mean is if the destination may have most of the files, it may not have only last 2 to 3 days file.
I am able to create the... (6 Replies)
Discussion started by: rrb2009
6 Replies
8. Shell Programming and Scripting
Hi all,
Hope everyone is doing fine. I need a help in creating search script. I have file which contains job names and job recs. I need to select specific job name and next line which is job rec
job (BLREEXTT) {
Record B${cycle}${month}${year}000075;
follows BLCYRRTCHKT;
... (5 Replies)
Discussion started by: taksistalo
5 Replies
9. UNIX for Dummies Questions & Answers
Hi
Obviously first time poster here. I have been set the task of creating a network diagram for each of our clients in the business i work for. After identifying ip adresses of firewalls name servers and the like im got to the point where i found it impracticle to go through 254 ip address and... (6 Replies)
Discussion started by: jeked
6 Replies
10. Shell Programming and Scripting
Hi there
first of all, sry for my bad english and possible mistakes .-)
I write scripts for my server to get my live easier. So my next one will be a script, where I can find special files in a folder.
I put with a script of mine files in a folder on the server with following name... (5 Replies)
Discussion started by: bigsanch
5 Replies
LEARN ABOUT OPENSOLARIS
webminsetup
webminsetup(1m) webminsetup(1m)
NAME
webminsetup - Script to perform initial or update configuration changes to the Webmin server
SYNOPSIS
/usr/sfw/bin/webminsetup [-d]
DESCRIPTION
webmin(1m) is a web-based tool that provides a set of CGI files, PERL files, and a specialized httpd server for administerin various system
facilities and applications on the machine where the Webmin server is running.
webminsetup(1m) is used to perform the initial configuration, or to update an existing configuration in the case of an system or Webmin
upgrade.
Without options, webminsetup(1m) will prompt the user to provide responses for various configuration options. The script will display a
default answer for each of the questions, and hitting the return key will select those options.
OPTIONS
The following options are available for use with webminsetup(1m);
-d Run the script using all of the defaults, and not prompt the user for selections.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWwebminr, |
| | SUNWwebminu |
+--------------------+-----------------+
|Interface Stability | Evolving |
+--------------------+-----------------+
SEE ALSO
webmin(1m), attributes(5)
NOTES
In addition to the documentation and man pages included with Solaris, more information is available at
http://www.webmin.com
30 Oct 2004 webminsetup(1m)