Sponsored Content
Full Discussion: Shell Script Extraction
Special Forums UNIX and Linux Applications Infrastructure Monitoring Shell Script Extraction Post 302429696 by clx on Tuesday 15th of June 2010 07:39:28 AM
Old 06-15-2010
strange!!
What is the source of the file? did you transfer the file from dos/windows?


re-create the file with the same contents just to test.
if you having dos2unix utility, try that.

what is what I tried with your file,
Code:
$ cat juniper-MPLS-MIB.sev.snmptrap.lookup 
table juniper-MPLS-MIB_sev =
{
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspUp","1","2","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspChange","2","13","1800"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspPathDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspPathUp","1","2","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoUp","1","2","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoChange","2","13","1800"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathDown","3","1","0"},
{"SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathUp","1","2","0"}
}
default = {"Unknown","Unknown","Unknown"}
 
$ awk -F \" '/^\{"SNMPTRAP/{print $2}' *.sev.*.lookup
SNMPTRAP-juniper-MPLS-MIB-mplsLspUp
SNMPTRAP-juniper-MPLS-MIB-mplsLspDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspChange
SNMPTRAP-juniper-MPLS-MIB-mplsLspPathDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspPathUp
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoUp
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoChange
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathDown
SNMPTRAP-juniper-MPLS-MIB-mplsLspInfoPathUp
$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help with data extraction script

Hello all, Iam newbie here and to unix programming. I have the following text file. A:Woshington,B:London,C:Paris,D:Manchester,C:Lisbon,E:Cape town. Now I would like extract this and store in database. here is the script I have tried but it did work. CITY1:`echo "$text" | grep "A:"... (11 Replies)
Discussion started by: mam
11 Replies

2. Shell Programming and Scripting

Shell script for text extraction from a file

Hi All, I am new to Shell Scripting. I have a file consisting of XML messages.Each message is associated with a timestamp value(it is not a xml field).I need to extract\copy all messages in a particular time interval and put in another new file using Shell Scripting. My XML looks like... (3 Replies)
Discussion started by: vignesh53
3 Replies

3. Shell Programming and Scripting

How to use ssh execute other shell script on other host (shell script include nohup)?

i want use ssh on the host01 to execute autoexec.sh on the host02 like following : host01> ssh host02 autoexec.sh autoexec.sh include nohup command like follwing : nohup /home/jack/deletedata.sh & after i execute ssh host02 autoexec.sh one the host01. i can't found deletedata.sh... (1 Reply)
Discussion started by: orablue
1 Replies

4. Shell Programming and Scripting

Date and time range extraction via Awk or analysis script?

Hello does anyone know of an awk that will extract log file entries between a specific date and time range, eg: awk '/15\/Dec\/2010:16:10:00/, /15\/Dec\/2010:16:15:00/' access_log but one that works? Or a free command line log file analysis tool/script? I'd like to be able to view... (2 Replies)
Discussion started by: competitions
2 Replies

5. Shell Programming and Scripting

Pattern extraction and usage by shell script

Suppose im in a directory A. which has sub-directories x/y/z m/n/p etc. Iam only considered with those which have a file netl.oa at the lowermost level. So i used the find command which gives me a list in the form ./abc/def/ghi/jkl/netl.oa and so on Now i want the names abc def jkl and ghi. My... (3 Replies)
Discussion started by: sid.verycool
3 Replies

6. Shell Programming and Scripting

Correct shell script to Call One shell script from another shell script

Hi All, I have new for shell scripting. Problem : I have one scrip at serv1 and path of server is /apps/dev/provimage/scripts and script name:extract_ancillary.bat. I need to call this script at server2(my working server) and execute at server2 . Please let me know how to build the... (5 Replies)
Discussion started by: Vineeta Nigam
5 Replies

7. Shell Programming and Scripting

Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk... (2 Replies)
Discussion started by: Ashunayak
2 Replies

8. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

9. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

10. UNIX for Beginners Questions & Answers

Script for extraction of pattern

Anyone can help here, with a script to extract the highlighted details from this two blocks?Actually there are milions of block, this is a sample? dn: EpsStaInfId=EpsStaInf,serv=EPS,mscId=aaaaaa001aaaaaaaa629100100138702,ou=multiSCs,dc=mtncg structuralObjectClass: EpsStaticInf objectClass:... (19 Replies)
Discussion started by: gillesi
19 Replies
file-roller(1)						      General Commands Manual						    file-roller(1)

NAME
file-roller - archive manager for GNOME SYNOPSIS
file-roller [OPTIONS...] [FILE...] DESCRIPTION
File Roller is a graphical interface to archiving utilities such as tar and zip. It supports most common operations such as creating, modifing and extracting files from an archive. You can also view the contents of an archive and open files contained in the archive. OPTIONS
-a, --add-to=ARCHIVE Add files to the specified archive and quit the program -d, --add FILE Add files asking the name of the archive and quit the program -e, --extract-to=FOLDER Extract archives to the specified folder and quit the program -f, --extract Extract archives asking the destination folder and quit the program -h, --extract-here Extract archives using the archive name as destination folder and quit the program --default-dir=FOLDER Default folder to use for the '--add' and '--extract' commands --force Create destination folder without asking confirmation This program also accepts the standard GNOME and GTK options. AUTHORS
file-roller is written by Paolo Bacchilega <paolo.bacch@tin.it>. This manual page was written by Sven Arvidsson <sa@whiz.se>, for the Debian project (but may be used by others). SEE ALSO
gtk-options(7), gnome-options(7) The online documentation available through the program's Help menu. GNOME
2007-09-27 file-roller(1)
All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy