Sponsored Content
Full Discussion: AWK script getting failed
Top Forums Shell Programming and Scripting AWK script getting failed Post 302353248 by unknown123 on Tuesday 15th of September 2009 02:05:37 AM
Old 09-15-2009
Data AWK script getting failed

Hi All,

Below is my code , In the code below the "If" condition is getting failed. I dont know what is getting wrong here , may be i can not use may logical operator at once or something else OR brackets under If condition are to be organised .

Please help!!

Code:
 if ($11 == "0" && (substr($18,5,1) == "S" && (substr($18,4,1) == "O" || substr($18,21,1) == "O")))
    {
                       Instru="CDCS"
                  }
                    Line=Instru "|" $11 "|" $12 "|" $18
                     if (Instru != "NULL")
                     {
                        gsub(" ","",Line)
                        print Line
                     }
                }' $FichierData1 > $FichierData3


please help..

Last edited by Franklin52; 09-15-2009 at 06:21 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Rerunning a command in a script that failed?

I have a script that occasionally has a command here and there that fails and I would like to set my script up to just re run the command if the exit code is 1. Is there a simple way to do that without if/thens or redirecting to the command again? (5 Replies)
Discussion started by: trey85stang
5 Replies

2. Shell Programming and Scripting

Need to start a script from the point where it failed.

Hi Guys, I have requirement where if the script fails at a particular point, then the script should run from that particular point itslf.. could anyone help me out from this.. Thanks (5 Replies)
Discussion started by: mac4rfree
5 Replies

3. Shell Programming and Scripting

Script exits with $? not 0 randomly, how can I see what command failed?

Hi! I have this situation with 3 shellscripts. One is a "startscript" that simply calls other scripts. This one is scheduled with cron to run at regular intervals. That script runs what I'll refer to as Script 1. Script 1 in turn runs script 2 (import_catalogs_buyer.sh) Sometimes, seemingly... (2 Replies)
Discussion started by: trailsmoke
2 Replies

4. Shell Programming and Scripting

script for failed processes

I want to write a script that log all the failed processes and start the same process. For that I have already write a script that gives all the PID #!/bin/ksh pid= `ps -ef |grep "ov" |grep -v "grep"| awk '{print $2}'` echo $pid if ; then echo "process is running" else echo... (4 Replies)
Discussion started by: kumarabhi84
4 Replies

5. Shell Programming and Scripting

Another question for tracking failed logins via script

Hello Experts, I have this initial shell script that tracks failed login attempts: #!/bin/bash #Fetch failed user logins to file failed-logins.txt grep -i failed /var/log/secure | awk '{ print $1, $2" ", $3" ", $9" ", $11 }' > failed-logins.txt #Splitting the failed-logins in... (10 Replies)
Discussion started by: linuxgeek
10 Replies

6. UNIX for Advanced & Expert Users

Need A Script To List All Failed Log In Users

I need to list all the failed log in users as part of audit report. How can I do so in Linux to find all the audit log records and then upload to a table for future reference. I am using oracle 10g on Linux. Hope I will get a quick response from the experts. Thanks in advance for the tips. (3 Replies)
Discussion started by: oraQ
3 Replies

7. Solaris

Script redirect command output failed, why?

Hi, I put a for loop in a script to eject backup tapes from the robot. The command echo' output goes to the log file without problem, but command vmchange's output does not go to the log file although it's working fine. It still displays on the screen. I've tried '2>&1 1>$log', but nothing changed.... (5 Replies)
Discussion started by: aixlover
5 Replies

8. Shell Programming and Scripting

ksh script failed while using -x

Hi, I have a Kshell script that is failed if i am using the -x option. $ cat ListOfFiles.lst \+DATA_DM01/pudwh/datafile/dw_billing_tts_1 \+DATA_DM01/pudwh/datafile/dw_billing_tts_2 ... (2 Replies)
Discussion started by: yoavbe
2 Replies

9. Shell Programming and Scripting

My script failed and can't fix it ?

Hi , I'd like to give you a little bit idea about my script which is used to get any generated file from remote server using ftp session then organized those file into directories based on their date ( at the end I supposed to have 1 months directories 20130401 20130402 ....20130430 ,... (27 Replies)
Discussion started by: arm
27 Replies

10. Shell Programming and Scripting

Bash Script Locate Word Failed

I'm using CentOS 7 and I would like to know of a way to read each line and search for a specific word. For example, if it finds the word "Fail" it sends it to a variable, and pipes it to a folder on the network. What would be the best way in making this work in a Linux environment? I wrote a... (1 Reply)
Discussion started by: SysAdminRialto
1 Replies
Unicode::GCString(3pm)					User Contributed Perl Documentation				    Unicode::GCString(3pm)

NAME
Unicode::GCString - String as Sequence of UAX #29 Grapheme Clusters SYNOPSIS
use Unicode::GCString; $gcstring = Unicode::GCString->new($string); DESCRIPTION
Unicode::GCString treats Unicode string as a sequence of extended grapheme clusters defined by Unicode Standard Annex #29 [UAX #29]. Grapheme cluster is a sequence of Unicode character(s) that consists of one grapheme base and optional grapheme extender and/or XprependX character. It is close in that people consider as character. Public Interface Constructors new (STRING, [LINEBREAK]) Constructor. Create new grapheme cluster string (Unicode::GCString object) from Unicode string STRING. Optional Unicode::LineBreak object LINEBREAK controls breaking features. copy Copy constructor. Create a copy of grapheme cluster string. Next position of new string is set at beginning. Sizes chars Instance method. Returns number of Unicode characters grapheme cluster string includes, i.e. length as Unicode string. columns Instance method. Returns total number of columns of grapheme clusters defined by built-in character database. For more details see "DESCRIPTION" in Unicode::LineBreak. length Instance method. Returns number of grapheme clusters contained in grapheme cluster string. Operations as String as_string """OBJECT""" Instance method. Convert grapheme cluster string to Unicode string explicitly. cmp (STRING) STRING "cmp" STRING Instance method. Compare strings. There are no oddities. One of each STRING may be Unicode string. concat (STRING) STRING "." STRING Instance method. Concatenate STRINGs. One of each STRING may be Unicode string. Note that number of columns (see columns()) or grapheme clusters (see length()) of resulting string is not always equal to sum of both strings. Next position of new string is that set on the left value. join ([STRING, ...]) Instance method. Join STRINGs inserting grapheme cluster string. Any of STRINGs may be Unicode string. substr (OFFSET, [LENGTH, [REPLACEMENT]]) Instance method. Returns substring of grapheme cluster string. OFFSET and LENGTH are based on grapheme clusters. If REPLACEMENT is specified, substring is replaced by it. REPLACEMENT may be Unicode string. Operations as Sequence of Grapheme Clusters as_array "@{"OBJECT"}" as_arrayref Instance method. Convert grapheme cluster string to an array of grapheme clusters. eos Instance method. Test if current position is at end of grapheme cluster string. item ([OFFSET]) Instance method. Returns OFFSET-th grapheme cluster. If OFFSET was not specified, returns next grapheme cluster. next "<"OBJECT">" Instance method, iterative. Returns next grapheme cluster and increment next position. pos ([OFFSET]) Instance method. If optional OFFSET is specified, set next position by it. Returns next position of grapheme cluster string. Methods palanned to be deprecated flag ([OFFSET, [VALUE]]) Instance method. Get or set flag value of OFFEST-th grapheme cluster. If OFFSET was not specified, returns flag value of next grapheme cluster. Flag value is an non-zero integer not greater than 255 and initially is 0. Predefined flags are: Unicode::LineBreak::ALLOW_BEFORE Allow line breaking just before this grapheme cluster. Unicode::LineBreak::PROHIBIT_BEFORE Prohibit line breaking just before this grapheme cluster. lbclass ([OFFSET]) Returns Line Breaking Class (See Unicode::LineBreak) of the first character of OFFSET-th grapheme cluster. If OFFSET was not specified, returns class of next grapheme cluster. Note: Use lbc(). lbclass_ext ([OFFSET]) Returns Line Breaking Class (See Unicode::LineBreak) of the last grapheme extender of OFFSET-th grapheme cluster. If there are no grapheme extenders or its class is CM, value of lbclass() is returned. Note: Use lbcext(). Miscelaneous lbc Returns Line Breaking Class (See Unicode::LineBreak) of the first character of first grapheme cluster. lbcext Returns Line Breaking Class (See Unicode::LineBreak) of the last grapheme extender of last grapheme cluster. If there are no grapheme extenders or its class is CM, value of last grapheme base will be returned. CAVEATS
o The grapheme cluster should not be referred to as "grapheme" even though Larry does. o On Perl around 5.10.1, implicit conversion from Unicode::GCString object to Unicode string sometimes let "utf8_mg_pos_cache_update" cache be confused. For example, instead of doing $sub = substr($gcstring, $i, $j); do $sub = substr("$gcstring", $i, $j); $sub = substr($gcstring->as_string, $i, $j); o This module implements default algorithm for determining grapheme cluster boundaries. Tailoring mechanism has not been supported yet. VERSION
Consult $VERSION variable. Development versions of this module may be found at http://hatuka.nezumi.nu/repos/Unicode-LineBreak/ <http://hatuka.nezumi.nu/repos/Unicode-LineBreak/>. SEE ALSO
[UAX #29] Mark Davis (2009-2010). Unicode Standard Annex #29: Unicode Text Segmentation, Revision 15-17. <http://www.unicode.org/reports/tr29/>. AUTHOR
Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu> COPYRIGHT
Copyright (C) 2009-2012 Hatuka*nezumi - IKEDA Soji. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-03-24 Unicode::GCString(3pm)
All times are GMT -4. The time now is 02:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy