Sponsored Content
Top Forums Shell Programming and Scripting Awk script problem - Variables Causing Issue Post 302607891 by SkySmart on Thursday 15th of March 2012 02:59:15 PM
Old 03-15-2012
Awk script problem - Variables Causing Issue

can someone please explain to me what i'm doing wrong with this code:

Code:
WELT=$(awk '(($1 ~ "^${caag}$") || ($2 ~ "^${caag}$"))' /tmp/Compare.TEXT)


when run from the command line, it works. but it seems to be having a problem doing the comparison when variables are involved.

i tested from the command line and assigned a value to "caag", it wouldn't work.

but when i just replaced caag on the command line with the actual value, it passes.

i've been stalled all day by this. any help will be much appreciated.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Variable for -name causing issue in Find command

Hi there, I'm trying to find files that are greater then 30 days old, zip them and move to a different directory. I'm encountering an issue passing a variable (FilesToFind) to name within the find command. Here's the code I'm running: #! /usr/bin/sh FileDir=/home/ariba... (2 Replies)
Discussion started by: ParNone
2 Replies

2. Shell Programming and Scripting

Environment variables causing cronjob to fail

I am trying to run a script which makes use of these environment variables, hence i need to export them out. i've posted a similar post in an oracle forum. I've posted the same qn here to get some advise on the scripting aspect. i execute my program in an unix environment by typeing... (2 Replies)
Discussion started by: new2ss
2 Replies

3. IP Networking

Could a tcp issue be causing a null pointer exception?

The client's app gets a 'suspend error' which they say is due to a null pointer exception. Application people say nothing's wrong with the app. Network people say the network's fine. I'm supposed to see what's wrong with the system to be causing this error. I checked the NIC card settings, which... (1 Reply)
Discussion started by: pmichner
1 Replies

4. Shell Programming and Scripting

Problem with variables in awk

Hi, I've a problem with wariables in awk. My example: $ cat test.txt 12|aaaa 13|bbbb 012|cccc 0123|dddd $ cat test.awk $1 == var {print $0} $ cat test.sh /usr/xpg4/bin/awk -F"|" -v var="012" -f test.awk test.txt (5 Replies)
Discussion started by: apresa
5 Replies

5. UNIX for Dummies Questions & Answers

Issue with variables via cronned script

I have script sourcing the profile of functional user like as below and my .profile for functional user has below entry now when i cron the script i am receiving the below error after execution, though i could see the output of variable when i do echo as below. can you tell me where... (11 Replies)
Discussion started by: Ariean
11 Replies

6. Shell Programming and Scripting

awk issue expanding variables in ksh script

Hi Guys, I have an issue with awk and variables. I have trawled the internet and forums but can't seem to get the exactt syntax I need. I have tried using awk -v and all sorts of variations but I have hit a brick wall. I have spent a full day on this and am just going round in circles. ... (3 Replies)
Discussion started by: gazza-o
3 Replies

7. Shell Programming and Scripting

Text qualifier issue causing data alignment problem

Hello Everyone, I have a csv file with text qualifier as "" and data similar to below: "1","abc","address1","US" "2","def","address1 "characters in double-quote" address2","IND" "3","ghi","address1","UK" In above example, for record 2, we have an issue as in column3 contains double... (2 Replies)
Discussion started by: AnkitSenghani
2 Replies

8. Shell Programming and Scripting

Scripting Issue with Variables from awk

Greetings all, Disclaimer: I'm a novice and always welcome best practices as I'm learning. File example: 100,1.1.1.1,1.1.1.2,10.10.10.1,172.16.1.10,172.16.1.20 101,1.1.2.1,1.1.2.2,10.10.20.1,172.16.2.10,172.16.2.20 102,1.1.3.1,1.1.3.2,10.10.30.1,172.16.3.10,172.16.3.20 ...and so on ... (3 Replies)
Discussion started by: sjrupp
3 Replies

9. Solaris

Solaris 5.8 Upgrade is causing Date format issue.

Hi I have a JAVA based application in development and production environment. These two environments are exactly identical in terms of OS, hardware and application components. Initially the OS was Solaris 5.6 and the application was working fine in both environments. But later when the OS... (12 Replies)
Discussion started by: Jayant Tripathi
12 Replies

10. Shell Programming and Scripting

Issue in shell script variables

Hi, I have a file at $HOME/t.txt, below is file content cat $HOME/t.txt CUSTOMER_${REGION}.out Am using this file content in one script $HOME/samp.sh, below is the script #!/bin/bash REGION=USA x=`cat ${HOME}/t.txt` echo $x Am getting following output.. CUSTOMER_${REGION}.out ... (3 Replies)
Discussion started by: shieksir
3 Replies
Locale::Currency(3)					User Contributed Perl Documentation				       Locale::Currency(3)

NAME
Locale::Currency - standard codes for currency identification SYNOPSIS
use Locale::Currency; $curr = code2currency('usd'); # $curr gets 'US Dollar' $code = currency2code('Euro'); # $code gets 'eur' @codes = all_currency_codes(); @names = all_currency_names(); DESCRIPTION
The "Locale::Currency" module provides access to standard codes used for identifying currencies and funds, such as those defined in ISO 4217. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 4217 three-letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying currencies. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $curr = code2currency('usd','alpha'); $curr = code2currency('usd',LOCALE_CURR_ALPHA); The codesets currently supported are: alpha, LOCALE_CURR_ALPHA This is a set of three-letter (uppercase) codes from ISO 4217 such as EUR for Euro. Two of the codes specified by the standard (XTS which is reserved for testing purposes and XXX which is for transactions where no currency is involved) are omitted. This is the default code set. num, LOCALE_CURR_NUMERIC This is the set of three-digit numeric codes from ISO 4217. ROUTINES
code2currency ( CODE [,CODESET] ) currency2code ( NAME [,CODESET] ) currency_code2code ( CODE ,CODESET ,CODESET2 ) all_currency_codes ( [CODESET] ) all_currency_names ( [CODESET] ) Locale::Currency::rename_currency ( CODE ,NEW_NAME [,CODESET] ) Locale::Currency::add_currency ( CODE ,NAME [,CODESET] ) Locale::Currency::delete_currency ( CODE [,CODESET] ) Locale::Currency::add_currency_alias ( NAME ,NEW_NAME ) Locale::Currency::delete_currency_alias ( NAME ) Locale::Currency::rename_currency_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Currency::add_currency_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Currency::delete_currency_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.iso.org/iso/support/currency_codes_list-1.htm The ISO 4217 data. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001 Michael Hennecke Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2013 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-06-03 Locale::Currency(3)
All times are GMT -4. The time now is 07:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy