The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help NEEDED urgently on exceutable file jagan_kalluri UNIX for Dummies Questions & Answers 5 05-29-2008 04:06 PM
Need help urgently user_prady Shell Programming and Scripting 3 09-03-2007 10:51 PM
Major Help Urgently Needed!!!! billett05 UNIX for Dummies Questions & Answers 3 07-20-2005 03:55 PM
Need Information Urgently. sumit_krishan UNIX for Dummies Questions & Answers 3 06-08-2005 07:13 AM
Shell Script needed urgently vas_dba Shell Programming and Scripting 2 03-11-2005 09:00 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-07-2008
nabmufti nabmufti is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 15
Question help needed urgently

hi all
i need help
I am confused and stucked. Actually i am new in this scripting stuff. I want to give complete txt file as a input to a variable and then sort the data in the file according to the alpha numeric characters, as my text file contains ! and !! and !!! indicating Minor, Major and Critical repectively. Each alpha numeric represent new entry. I am trying to do but all in vain, help needed plz,
codes which i am trying are as follows,

[code]:

#!/bin/bash
alarmfile= `cat ~/alkatel.txt`
[\code]

i tried so many times but whenever i try to take file as input by code above but i got the output

>> : command not found

its a long file ,im sending a part of this text file that i want to take as input

example of file

>> ALAIL;

CMD ALAIL 06095 08-01-30 11-58-23
INP ALAIL 06095 08-01-30 11-58-23
OPTEX=



RES ALAIL 06095 08-01-30 11-58-24
CEN=1/08-01-30/11 H 58 MN 19/STORED ALARMS LIST
PROCESSING TPFFIR ACC


! *A0628/540 /07-12-17/15 H 58/N=7598/TYP=ICT/CAT=SI/EVENT=MAL
/NCEN=MULCT /AM =SMTA1/AGEO=S1-TR01-B03-A085-R000
/TEXAL=AIS/COMPL.INF:
/AF=URMA1
/ ICTRQ AGCA=S1-TR01-B03-A112-R065
/AMET=01-07-02
/AFLR=222-09/CRC=NACT
!!! *A0628/303 /07-12-17/15 H 46/N=7501/TYP=COM/CAT=IM/EVENT=MAL
/NCEN=MULCT /AFUR =URAD- 4/AGEO=BUDLASAN-B01
/TEXAL=SINGLE JUNCT/UT OOS/COMPL.INF:
/CN=3

if i removed these >> operators from the start of file i again got the same output

ALAIL ; :command not found

even this file doesnt have executeable permission but still i am getting this message
i am so confused as i am still at my first step since 3 days
please help me, why it doesnt take the whole file as text input rather the first word and ignorin the rest of file

as i told befor ! & !!! showing minor & critical alarms.its a log file of alkatel switch & i have to extract

!!! , !! , !
with relevant
date & time e.g !!! */07-12-17/15 H 46/
event i.e. EVENT=MAL
& texal i.e. /TEXAL=SINGLE JUNCT/UT OOS/COMPL.INF

i collected stuff about reg exp from this site to take yhe substring but couldnt find a way still

let me make it very clear that i need this script in bash onlynot perl and any other language

i tried another script to extract entry components from the file as
Code:
:
#!/bin/bash
var=~/alkatel.txt
while read line $var
do
{
echo $line
}done
but the out put became the infinite loop of the first line as

>> ALAIL; :command not found

can any one do it
waiting for reply soon
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0