Sponsored Content
Top Forums Shell Programming and Scripting Why does this awk script not work correctly? Post 302996702 by RudiC on Monday 1st of May 2017 04:31:16 AM
Old 05-01-2017
If the order of the indic glosses is unimporrtant, try also
Code:
awk -F= '
        {for (MX=n=split($2, T, ","); n>0; n--) C[T[n]]
         printf "%s=", $1
         DL = ""
         for (c in C)   {printf "%s%s", DL, c
                         DL = ","
                        }
         printf RS
         split ("",C)
        }
' file
10=दहा
10th=दहावा,दशम
11=एकादश,अकरा
11th=अकरावा
12=बारा
12th=बारावा
13=त्रयोदश,तेरा
13th=तेरावा
.
.
.
24-hour interval=दिवस
24-karat gold=खरे सोने,अस्सल सोने,शुद्ध सोने,बावनकशी सोने

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. SuSE

vsft doesn't work correctly

I install vsftpd server on 2 SUSE 10.2 servers. The first works perfectly, but the second doesn't work how I expect. The second works only over local network and doesn't over internet. The vsftpd.conf and ../xinetd.d/vsftpd are the same in 2 servers. The only different was when I threw to log in... (1 Reply)
Discussion started by: zhivko.neychev
1 Replies

2. Shell Programming and Scripting

Awk: first line not processed correctly

Hey, I've made a little awk-script which reorders lines. Works okay, only problem is that is doesn't process the first line correctly. If I switch lines in the Input file it doesn't proces this first line either. Somebody please help! Here's is the code and the input file! thanx ... (1 Reply)
Discussion started by: BartleDuc
1 Replies

3. Shell Programming and Scripting

Grep/awk not getting the message correctly

I have a script which will take two file as the inputs and take the Value in file1 and search in file2 and give the output in Outputfile. #!/bin/sh #. ${HOME}/crossworlds/bin/CWSharedEnv.sh FILE1=$1 FILE2=$2 for Var in $(cat $FILE1);do echo $Var grep -i "$Var" $FILE2 done > Outputfile I... (2 Replies)
Discussion started by: SwapnaNaidu
2 Replies

4. Shell Programming and Scripting

awk script to remove spaces - examples don't show up correctly

I have the following data from a manual database dump. I need to format the columns so that I can import them into an excel spread sheet. So far I have been able to get past the hurdles with vi and grep. Now I have one last issue that I can't get past. Here is an example of the data. Here is... (18 Replies)
Discussion started by: Chris_Rivera
18 Replies

5. Programming

Cannot get dbx to work correctly with a running process

Hi everyone, I've been struggling with this for a few weeks now. I'm trying to debug a running process with dbx on an AIX box. The command I'm using is 'dbx -a <pid> core' There is a function I can perform in my application that crashes this process, but it does not show up as crashed in... (0 Replies)
Discussion started by: ctote
0 Replies

6. Shell Programming and Scripting

awk not working correctly

Hi I am attempting to right a script which will read a table and extract specfic information. LASTFAILEDJOB=/usr/openv/netbackup/scripts/GB-LDN/Junaid/temp_files/lastfailedjob cat /usr/openv/netbackup/scripts/GB-LDN/Junaid/temp_files/lastfailedjob 237308646 If i run the following... (5 Replies)
Discussion started by: Junes
5 Replies

7. UNIX for Advanced & Expert Users

Libvirt does not work correctly anymore on my gentoo

Hi, Since a year my libvirtd does not work anymore on my Gentoodesktop. In the meantime a used virtualbox. But I would like to have back libvirt. The problem was after libvirt should not only work with root privileges. I deinstalled all things with libvirt an kvm. I removed all things from /var... (4 Replies)
Discussion started by: darktux
4 Replies

8. SCO

Set NIC correctly , but the network does not work

I'm trying to virtualize an instance of SCO Open Server 5.0.2c in VirtualBox (called VM- A) , I can not configure the network (NIC). The NIC I'm using is PCnet -FAST III (Am79C973 ) (this NIC works with VirtualBox + SCO 5.0.5M) When I add from ' Add new LAN adapter' I detects the NIC... (2 Replies)
Discussion started by: flako
2 Replies

9. Gentoo

LDAP-Auth does not work correctly with systemd

Hi, since the upgrade to Gnome 3.6 (now i have 3.8) the authentication over LDAP stops working. The whole machine does not start anymore. The machine boot, but no gdm and no X. I can login, with root, but then the tty hangs. When i look at ttyF12 i see a lot of systemd service the runs random,... (1 Reply)
Discussion started by: darktux
1 Replies

10. Shell Programming and Scripting

Work with setsid to open a session and close it correctly

I would like to create the following script: run a python script with setsid python may or may not fail with exception check if all of the group processes were terminated correctly if not, kill the remaining processes How can I do that? Thanks a lot (3 Replies)
Discussion started by: ASF Studio
3 Replies
Perl::Critic::Policy::NamingConventions::ProhibitAmbiguoUsermContributed Perl Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames(3pm)

NAME
Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames - Don't use vague variable or subroutine names like 'last' or 'record'. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Conway lists a collection of English words which are highly ambiguous as variable or subroutine names. For example, $last can mean previous or final. This policy tests against a list of ambiguous words for variable names. CONFIGURATION
The default list of forbidden words is: abstract bases close contract last left no record right second set This list can be changed by giving a value for "forbid" of a series of forbidden words separated by spaces. For example, if you decide that "bases" is an OK name for variables (e.g. in bioinformatics), then put something like the following in "$HOME/.perlcriticrc": [NamingConventions::ProhibitAmbiguousNames] forbid = last set left right no abstract contract record second close BUGS
Currently this policy checks the entire variable and subroutine name, not parts of the name. For example, it catches $last but not $last_record. Hopefully future versions will catch both cases. Some variable statements will be false positives if they have assignments where the right hand side uses forbidden names. For example, in this case the "last" incorrectly triggers a violation. my $previous_record = $Foo::last; AUTHOR
Chris Dolan <cdolan@cpan.org> COPYRIGHT
Copyright (c) 2005-2011 Chris Dolan. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-06-07Perl::Critic::Policy::NamingConventions::ProhibitAmbiguousNames(3pm)
All times are GMT -4. The time now is 04:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy