Sponsored Content
Top Forums Shell Programming and Scripting Split the file and access that files through array and loop Post 302763521 by kalidoss on Wednesday 30th of January 2013 05:47:29 AM
Old 01-30-2013
Hi Corona,

I have tried your code , i got the below error...

syntax error at line 6 : `done' unexpected

regards,
Kalidoss
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Access value outside awk or split value of array

Hello I am new to Unix. Please help me out. My Scenario: I am first collecting all the file names present in the directory with structure myinfo/yourinfo/supplierinfo I have four files with the names myCollector.java, yourCollector.java, someCollector.java, everyCollector.java. in the directory.... (1 Reply)
Discussion started by: jason.bean
1 Replies

2. Shell Programming and Scripting

split and making an array inside another array

I want to run an awk split on a value that has been pushed through an array and I was wondering what the syntax should be?? e.g. running time strings through an array and trying to examine just minutes: 12:25:30 10:15:13 08:55:23 awk ' NR==FNR{ ... (2 Replies)
Discussion started by: dcfargo
2 Replies

3. Shell Programming and Scripting

How to run a loop for assigning strings which are present in a file to an array

Hi Forum, I am struggling with the for loop in shell script. Let me explain what is needed in the script. I have a file which will conatin some strings like file1 place1 place2 place3 checkpoint some other text some more text Now what my requirement is the words ... (2 Replies)
Discussion started by: siri_14
2 Replies

4. Shell Programming and Scripting

Not access variable outside loop when a reading a file

I am writing a shell script using the korn shell. It seems that I am only able to use local variables within a while loop that is reading a file. (I can't access a variable outside a previously used while loop.) It's been a while since I wrote shell scripts. Here is a sample cat file.txt... (4 Replies)
Discussion started by: ricardo.ludwig
4 Replies

5. Shell Programming and Scripting

Push records to array during implicit loop and write to file

NEWBIE ALERT! Hi, I'm 1 month into learning Perl and done reading "Minimal Perl" by Tim Maher (which I enjoyed enoumously). I'm not a programmer by profession but want to use Perl to automate various tasks at my job. I have a problem (obviously) and are looking for your much appreciated help.... (0 Replies)
Discussion started by: jospan
0 Replies

6. Shell Programming and Scripting

problem access array outside of loop in bash

Below is a test script I was trying to use so that I could understand why the logic was not working in a larger script. While accessing and printing array data inside the while loop, everything is fine. Outside the loop, i guess everything is null?? The for loop that is meant to cycle... (4 Replies)
Discussion started by: adlmostwanted
4 Replies

7. Shell Programming and Scripting

Array Variable being Assigned Values in Loop, But Gone when Loop Completes???

Hello All, Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....? I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies

8. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

9. Shell Programming and Scripting

Split list of files into an array and pass to function

There are two parts to this. In the first part I need to read a list of files from a directory and split it into 4 arrays. I have done that with the following code, # collect list of file names STATS_INPUT_FILENAMES=($(ls './'$SET'/'$FOLD'/'*'in.txt')) # get number of files... (8 Replies)
Discussion started by: LMHmedchem
8 Replies

10. Shell Programming and Scripting

Split a file into 10 different files

OS : RHEL 6.7 Shell : bash I have a text file with 5.97 million lines. I want to split this big file into 12 different files (in sequential order) so that each file will contain roughly 500K lines. I tried the following awk command after googling. But, it just created 2 files... (5 Replies)
Discussion started by: omega3
5 Replies
smilint(1)							     SMI Tools								smilint(1)

NAME
smilint - syntax and semantic checks of SMIv1/v2 and SPPI modules SYNOPSIS
smilint [ -Vhersm ] [ -c file ] [ -p module ] [ -l level ] [ -i error-pattern ] module(s) DESCRIPTION
The smilint program is used to check MIB or PIB modules for syntax errors and semantics at some degree. SMIv1/v2 style MIB modules as well as SPPI PIB modules are supported. The rules that smilint is based on are taken from RFC 1155, RFC 1212 and RFC 1215 for SMIv1, RFCs 2578-2580 for SMIv2, RFC 3159 for SPPI. OPTIONS
-V, --version Show the smilint version and exit. -h, --help Show a help text and exit. -e, --error-list Show a list of all known error messages and exit. Error messages can have associated tags, shown in braces at the end of each line. The tags can be used with the -i option to ignore certain error messages. -r, --recursive Report errors and warnings also for recursively imported modules. -s, --severity Show the error severity in brackets before error messages. -m, --error-names Show the error names in braces before error messages. -c file, --config=file Read file instead of any other (global and user) configuration file. -p module, --preload=module Preload the module module before reading the main module(s). This may be helpful if an incomplete main module misses to import some definitions. -l level, --level=level Report errors and warnings up to the given severity level. See below for a description of the error levels. The default error level is 3. -i prefix, --ignore=prefix Ignore all errors that have a tag which matches prefix. A list of error tags can be retrieved by calling smilint with the -e option. module(s) These are the modules to be checked. If a module argument represents a path name (identified by containing at least one dot or slash character), this is assumed to be the exact file to read. Otherwise, if a module is identified by its plain module name, it is searched according to libsmi internal rules. See smi_config(3) for more details. ERROR AND WARNING LEVELS
All generated error and warning messages have an associated severity level. The actual severity levels are: 0 Internal error, no recovery possible. Examples are memory allocation failures. Errors of this level usually cause the application to abort. 1 Major SMI/SPPI error, recovery somehow possible but may lead to severe problems. Examples are lexically unexpected characters or unknown keywords. Errors of this kind usually lead to follow-on errors. 2 SMI/SPPI error which is probably tolerated by some implementations. Examples are MIB/PIB modules which mix constructs from different SMI/SPPI versions. 3 SMI/SPPI error which is likely tolerated by many implementations. Examples are misplaced SMIv2 MODULE-IDENTITY invocations or SMIv2 tex- tual conventions derived from other textual conventions. 4 Something which is not strictly an error but which is recommended to be changed. Warnings of this level are usually considered during MIB reviews. 5 Something that is basically correct but might be problematic in certain environments or usage scenarios. Examples are warnings that identifiers only differ in case or that type definitions are not used within the defining module. 6 Messages of this level are auxiliary notices. Examples are messages that point to a previous definition in case of a redefinition. Higher levels are currently not used and lead to the same effects as level 6 does. Note that errors up to level 3 are errors violating the specifications and must be fixed by the responsible author. The warnings generated with level 4 should be considered during normal MIB/PIB reviews. EXAMPLE
This example checks the file RMON2-MIB in the current directory (note that the `./' prefix ensures this). The error level is raised to 6 and warnings that claim about identifier names that exceed a length of 32 characters are suppressed. $ smilint -l 6 -i namelength-32 ./RMON2-MIB ./RMON2-MIB:3935: unexpected type restriction ./RMON2-MIB:3936: unexpected type restriction ./RMON2-MIB:3937: unexpected type restriction ./RMON2-MIB:3938: unexpected type restriction ./RMON2-MIB:3939: unexpected type restriction ./RMON2-MIB:3940: unexpected type restriction ./RMON2-MIB:4164: scalar object must not have a `read-create' access value SEE ALSO
The libsmi(3) project is documented at http://www.ibr.cs.tu-bs.de/projects/libsmi/. Other commonly used MIB checkers are mosy(1) and smicng(1). AUTHORS
(C) 1999-2004 F. Strauss, TU Braunschweig, Germany <strauss@ibr.cs.tu-bs.de> (C) 1999-2002 J. Schoenwaelder, TU Braunschweig, Germany <schoenw@ibr.cs.tu-bs.de> (C) 2002-2003 J. Schoenwaelder, University of Osnabrueck, Germany (C) 2003-2004 J. Schoenwaelder, International University Bremen, Germany (C) 2001-2002 T. Klie, TU Braunschweig, Germany <tklie@ibr.cs.tu-bs.de> (C) 2002 M. Bunkus, TU Braunschweig, Germany <bunkus@ibr.cs.tu-bs.de> and contributions by many other people. IBR
August 10, 2004 smilint(1)
All times are GMT -4. The time now is 01:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy