Sponsored Content
Top Forums Shell Programming and Scripting Piping fails in locale other than English Post 302670723 by jim mcnamara on Thursday 12th of July 2012 10:59:48 AM
Old 07-12-2012
$0 is the name of the script you are running, not the parameter

ex:
Code:
# myscript.sh
echo "the code executing this is $0"
echo "my first parameter is $1"

Code:
$>  ./myscript.sh  t.lis
the code executing this is ./myscript.sh
my first parameter is t.lis
$>

 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Please decode in English

Hello: Can anyone please decode this script in English. I have also made some comments which I know.. The actual script does not have one comment also.. #! /bin/ksh . odbmsprd_env.ksh #setting the env.. echo $0 Started at : `date '+%d-%m-%Y %H:%M:%S'` # what's echo $0 ... (4 Replies)
Discussion started by: ST2000
4 Replies

2. SCO

gzip english version

Hello, i'm not skilled on unix, i'd like gzip/gunzip software and, ESPECIALLY, the detailed instructions for installation....please help me......i'm like a baby in unix world!!!!! hello, thanks a lot! mike (3 Replies)
Discussion started by: mfran2002
3 Replies

3. Ubuntu

LANG=C not English?

On Ubuntu 7.04, why would the "C" LANG parameter not be English: $ LANG=C locale LANG=C LANGUAGE=he_IL:he:en_GB:en LC_CTYPE="he_IL.utf8" LC_NUMERIC="he_IL.utf8" LC_TIME="he_IL.utf8" LC_COLLATE="he_IL.utf8" LC_MONETARY="he_IL.utf8" LC_MESSAGES="he_IL.utf8" LC_PAPER="he_IL.utf8"... (4 Replies)
Discussion started by: dotancohen
4 Replies

4. Red Hat

Displaying the available locales in english

Hi, I am developing a program that would ask the user to set the locale. For that, I need to display them to user in plain english. like English(US) English (Uk) depending on the user selection I need to set the locale. Is there a command in redhat linux that would... (1 Reply)
Discussion started by: eamani_sun
1 Replies

5. UNIX for Dummies Questions & Answers

translate to normal english

lnode * head = temp; (1 Reply)
Discussion started by: rickym2626
1 Replies

6. Shell Programming and Scripting

convert english to chinese

Hi Experts, Can anyone help me to convert a english input into chinese in a bash script. help would be highly appreciable. thanks, Deepak (3 Replies)
Discussion started by: naw_deepak
3 Replies

7. Shell Programming and Scripting

Translate from english to french

Hi, I wrote a script to convert a given word from English to French. But I am not able to figure out what I am missing here. I am not able to get the translated word Below is my script: French=/root/dict/entofr.txt for i in $* do word="echo $word $i" done while: do cat <<... (1 Reply)
Discussion started by: pinky7630
1 Replies

8. Shell Programming and Scripting

How to convert number to english?

Hi gurus, I have a weird requirement. I need to convert the number to english lecture. I have 1.2 ....19 numbers I need to convert to first second third fourth, fifth, sixth... Is there any way convert it using unix command? thanks in advance. (8 Replies)
Discussion started by: ken6503
8 Replies
Pdlpp(3)						User Contributed Perl Documentation						  Pdlpp(3)

NAME
Inline::Pdlpp - Write PDL Subroutines inline with PDL::PP DESCRIPTION
"Inline::Pdlpp" is a module that allows you to write PDL subroutines in the PDL::PP style. The big benefit compared to plain "PDL::PP" is that you can write these definitions inline in any old perl script (without the normal hassle of creating Makefiles, building, etc). Since version 0.30 the Inline module supports multiple programming languages and each language has its own support module. This document describes how to use Inline with PDL::PP (or rather, it will once these docs are complete ";)". For more information on Inline in general, see Inline. Some example scripts demonstrating "Inline::Pdlpp" usage can be found in the Example/InlinePdlpp directory. "Inline::Pdlpp" is mostly a shameless rip-off of "Inline::C". Most Kudos goes to Brian I. Usage You never actually use "Inline::Pdlpp" directly. It is just a support module for using "Inline.pm" with "PDL::PP". So the usage is always: use Inline Pdlpp => ...; or bind Inline Pdlpp => ...; Examples Pending availability of full docs a few quick examples that illustrate typical usage. A simple example # example script inlpp.pl use PDL; # must be called before (!) 'use Inline Pdlpp' calls use Inline Pdlpp; # the actual code is in the __Pdlpp__ block below $a = sequence 10; print $a->inc," "; print $a->inc->dummy(1,10)->tcumul," "; __DATA__ __Pdlpp__ pp_def('inc', Pars => 'i();[o] o()', Code => '$o() = $i() + 1;', ); pp_def('tcumul', Pars => 'in(n);[o] mul()', Code => '$mul() = 1; loop(n) %{ $mul() *= $in(); %}', ); # end example script If you call this script it should generate output similar to this: prompt> perl inlpp.pl Inline running PDL::PP version 2.2... [1 2 3 4 5 6 7 8 9 10] [3628800 3628800 3628800 3628800 3628800 3628800 3628800 3628800 3628800 3628800] Usage of "Inline::Pdlpp" in general is similar to "Inline::C". In the absence of full docs for "Inline::Pdlpp" you might want to compare Inline::C. Code that uses external libraries, etc The script below is somewhat more complicated in that it uses code from an external library (here from Numerical Recipes). All the relevant information regarding include files, libraries and boot code is specified in a config call to "Inline". For more experienced Perl hackers it might be helpful to know that the format is similar to that used with ExtUtils::MakeMaker. The keywords are largely equivalent to those used with "Inline::C". Please see below for further details on the usage of "INC", "LIBS", "AUTO_INCLUDE" and "BOOT". use PDL; # this must be called before (!) 'use Inline Pdlpp' calls use Inline Pdlpp => Config => INC => "-I$ENV{HOME}/include", LIBS => "-L$ENV{HOME}/lib -lnr -lm", # code to be included in the generated XS AUTO_INCLUDE => <<'EOINC', #include <math.h> #include "nr.h" /* for poidev */ #include "nrutil.h" /* for err_handler */ static void nr_barf(char *err_txt) { fprintf(stderr,"Now calling croak... "); croak("NR runtime error: %s",err_txt); } EOINC # install our error handler when loading the Inline::Pdlpp code BOOT => 'set_nr_err_handler(nr_barf);'; use Inline Pdlpp; # the actual code is in the __Pdlpp__ block below $a = zeroes(10) + 30;; print $a->poidev(5)," "; __DATA__ __Pdlpp__ pp_def('poidev', Pars => 'xm(); [o] pd()', GenericTypes => [L,F,D], OtherPars => 'long idum', Code => '$pd() = poidev((float) $xm(), &$COMP(idum));', ); Pdlpp Configuration Options For information on how to specify Inline configuration options, see Inline. This section describes each of the configuration options avail- able for Pdlpp. Most of the options correspond either to MakeMaker or XS options of the same name. See ExtUtils::MakeMaker and perlxs. AUTO_INCLUDE Specifies extra statements to automatically included. They will be added onto the defaults. A newline char will be automatically added. Does essentially the same as a call to "pp_addhdr". For short bits of code "AUTO_INCLUDE" is probably syntactically nicer. use Inline Pdlpp => Config => AUTO_INCLUDE => '#include "yourheader.h"'; BLESS Same as "pp_bless" command. Specifies the package (i.e. class) to which your new pp_defed methods will be added. Defaults to "PDL" if omit- ted. use Inline Pdlpp => Config => BLESS => 'PDL::Complex'; BOOT Specifies C code to be executed in the XS BOOT section. Corresponds to the XS parameter. Does the same as the "pp_add_boot" command. Often used to execute code only once at load time of the module, e.g. a library initialization call. CC Specify which compiler to use. CCFLAGS Specify extra compiler flags. INC Specifies an include path to use. Corresponds to the MakeMaker parameter. use Inline Pdlpp => Config => INC => '-I/inc/path'; LD Specify which linker to use. LDDLFLAGS Specify which linker flags to use. NOTE: These flags will completely override the existing flags, instead of just adding to them. So if you need to use those too, you must respecify them here. LIBS Specifies external libraries that should be linked into your code. Corresponds to the MakeMaker parameter. use Inline Pdlpp => Config => LIBS => '-lyourlib'; or use Inline Pdlpp => Config => LIBS => '-L/your/path -lyourlib'; MAKE Specify the name of the 'make' utility to use. MYEXTLIB Specifies a user compiled object that should be linked in. Corresponds to the MakeMaker parameter. use Inline Pdlpp => Config => MYEXTLIB => '/your/path/yourmodule.so'; OPTIMIZE This controls the MakeMaker OPTIMIZE setting. By setting this value to '-g', you can turn on debugging support for your Inline extensions. This will allow you to be able to set breakpoints in your C code using a debugger like gdb. TYPEMAPS Specifies extra typemap files to use. Corresponds to the MakeMaker parameter. use Inline Pdlpp => Config => TYPEMAPS => '/your/path/typemap'; BUGS
"do"ing inline scripts Beware that there is a problem when you use the __DATA__ keyword style of Inline definition and want to "do" your script containing inlined code. For example # myscript.pl contains inlined code # in the __DATA__ section perl -e 'do "myscript.pl";' One or more DATA sections were not processed by Inline. According to Brian Ingerson (of Inline fame) the workaround is to include an "Inline->init" call in your script, e.g. use PDL; use Inline Pdlpp; Inline->init; # perl code __DATA__ __Pdlpp__ # pp code "PDL::NiceSlice" and "Inline::Pdlpp" There is currently an undesired interaction between PDL::NiceSlice and "Inline::Pdlpp". Since PP code generally contains expressions of the type "$var()" (to access piddles, etc) PDL::NiceSlice recognizes those incorrectly as slice expressions and does its substitutions. For the moment (until hopefully the parser can deal with that) it is best to explicitly switch PDL::NiceSlice off before the section of inlined Pdlpp code. For example: use PDL::NiceSlice; use Inline::Pdlpp; $a = sequence 10; $a(0:3)++; $a->inc; no PDL::NiceSlice; __DATA__ __C__ ppdef (...); # your full pp definition here ACKNOWLEDGEMENTS
Brian Ingerson for creating the Inline infrastructure. AUTHOR
Christian Soeller <soellermail@excite.com> SEE ALSO
PDL PDL::PP Inline Inline::C COPYRIGHT
Copyright (c) 2001. Christian Soeller. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as PDL itself. See http://pdl.perl.org perl v5.8.0 2002-06-05 Pdlpp(3)
All times are GMT -4. The time now is 06:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy