Sponsored Content
Full Discussion: getopts in a subshell
Top Forums Shell Programming and Scripting getopts in a subshell Post 302497360 by Dahu on Thursday 17th of February 2011 03:41:51 AM
Old 02-17-2011
Thanks ...
Code:
$ ksh --version
  version         sh (AT&T Research) 93s+ 2008-01-31

I tried with bash and it works ...
Code:
$ bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)

I found those bugreports that seems to address the same issue:
bugzilla.redhat.com/show_bug.cgi?id=443889
bugzilla.redhat.com/show_bug.cgi?id=541654

This may be corrected with two ksh bug-fixes
rhn.redhat.com/errata/RHBA-2009-1256.html
rhn.redhat.com/errata/RHBA-2010-0234.html

I'l try to see with my sysadmin if he can update ksh.
If not, as I'm tied with ksh, I'll be doomed to find a workaround Smilie

(Sorry I couldn't use the full url as I don't have enough posts on this board Smilie)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Subshell Question

The profile of the user is empty. Then before I run the script I want I run a parameter file that populates the variables for oracle. ORACLE_HOME ORACLE_BASE ORACLE_SID PATH etc ... But it seems that these variables are not making it to the shell I am in because when I do an echo on... (6 Replies)
Discussion started by: lesstjm
6 Replies

2. Shell Programming and Scripting

passing of a varibale to subshell

Hi All, I need some info. Could you please tell me how to use the variable of a parent shell in the subshell. Also can we modify the variable in the subshell ? If yes, will the modified variable visible in the parent shell I am using two prg. a.sh #!/usr/bin/ksh temp_var="abhishek"... (3 Replies)
Discussion started by: AbhishekG
3 Replies

3. Shell Programming and Scripting

Passing arguments to the subshell

I have a shell script which is invoked by passing an argument. The outer shell script calls another subshell and I want the argument passed down to flow down to the subshell. E.g Invoking a shell ======>> abc_refresh.ksh NM Below is the content of abc_refresh.ksh Value1=$1... (7 Replies)
Discussion started by: Mihirjani
7 Replies

4. Shell Programming and Scripting

Killing a subshell

I am calling a script from with another script and reading its output one line at a time (using <childscript> | while read line) in the parent script. If the output exceeds a predefined number of lines I want to kill the child shell from within the parent shell. I decided to print the process ID... (2 Replies)
Discussion started by: slash_blog
2 Replies

5. Shell Programming and Scripting

While loop subshell problem

Hi, I have the below script while true; do read -p "Please enter schema password: " -s -e pswd1 echo read -p "Please retype schema password: " -s -e pswd2 echo && { echo -e "password mismatch.\n"; continue; } validateOraclePassword $pswd1... (2 Replies)
Discussion started by: varu0612
2 Replies

6. Shell Programming and Scripting

Basename in subshell

Hi All, I would like to improve my bash scripting skill and found a problem which I do not understand. Task is to search and print files in directory (and subdirecories) which contains its own name. Files can have spaces in name. This one works fine for files in main directory, but not for... (4 Replies)
Discussion started by: new_item
4 Replies

7. Shell Programming and Scripting

Getopts in the subshell of ksh

Hi, the getopts doesnt seem to be working in the subshell of the ksh. when I echo $@ and $* from the subshell it shows nothing. even when I am capturing the parameters from the outer shell and passing while invoking the file then I am still not getting it properly. the below code is in the... (9 Replies)
Discussion started by: hitmansilentass
9 Replies

8. Shell Programming and Scripting

Executing a command in subshell

Hi All, I am trying to create a shell script which runs on my linux machine. The requirement is so that, ade createview xyz -> this steps creates a view ade useview xyz -> we are entering inside the view ade begintrans -> begin a transaction My script has following code : lets say... (2 Replies)
Discussion started by: Dish
2 Replies

9. Shell Programming and Scripting

How will these subshell commands behave?

Hello, I am firing off some scripts from a main script, cd B/ ./EV_B_m0-m200_hex1.sh & ./EV_B_m0-m200_hex2.sh & wait ...more It would be useful to put a bit of time between the two to clean up the output to the terminal. I think this would work, cd B/ ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies

10. Shell Programming and Scripting

Help sending mail through subshell

Hey I have a shell script that is like this: ( echo "hi!" ##DO SOMETHING )&( sleep 5 ##EMAIL RECIPIENTS VARs ERECIPIENT3="email.com" echo "Connection on status: is Down"|mail -s "Subject:" ${ERECIPIENT3} kill -- -$$ ) This isn't working anyone know why? mail won't go out from... (12 Replies)
Discussion started by: mo_VERTICASQL
12 Replies
DBIx::Class::Manual::Troubleshooting(3pm)		User Contributed Perl Documentation		 DBIx::Class::Manual::Troubleshooting(3pm)

NAME
DBIx::Class::Manual::Troubleshooting - Got a problem? Shoot it. "Can't locate storage blabla" You're trying to make a query on a non-connected schema. Make sure you got the current resultset from $schema->resultset('Artist') on a schema object you got back from connect(). Tracing SQL The "DBIC_TRACE" environment variable controls SQL tracing, so to see what is happening try export DBIC_TRACE=1 Alternatively use the "storage->debug" class method:- $schema->storage->debug(1); To send the output somewhere else set debugfh:- $schema->storage->debugfh(IO::File->new('/tmp/trace.out', 'w'); Alternatively you can do this with the environment variable, too:- export DBIC_TRACE="1=/tmp/trace.out" Can't locate method result_source_instance For some reason the table class in question didn't load fully, so the ResultSource object for it hasn't been created. Debug this class in isolation, then try loading the full schema again. Can't get last insert ID under Postgres with serial primary keys Older DBI and DBD::Pg versions do not handle "last_insert_id" correctly, causing code that uses auto-incrementing primary key columns to fail with a message such as: Can't get last insert id at /.../DBIx/Class/Row.pm line 95 In particular the RHEL 4 and FC3 Linux distributions both ship with combinations of DBI and DBD::Pg modules that do not work correctly. DBI version 1.50 and DBD::Pg 1.43 are known to work. Can't locate object method "source_name" via package There's likely a syntax error in the table class referred to elsewhere in this error message. In particular make sure that the package declaration is correct. For example, for a schema " MySchema " you need to specify a fully qualified namespace: " package MySchema::MyTable; ". syntax error at or near "<something>" ... This can happen if you have a relation whose name is a word reserved by your database, e.g. "user": package My::Schema::User; ... __PACKAGE__->table('users'); __PACKAGE__->add_columns(qw/ id name /); __PACKAGE__->set_primary_key('id'); ... 1; package My::Schema::ACL; ... __PACKAGE__->table('acl'); __PACKAGE__->add_columns(qw/ user_id /); __PACKAGE__->belongs_to( 'user' => 'My::Schema::User', 'user_id' ); ... 1; $schema->resultset('ACL')->search( {}, { join => [qw/ user /], '+select' => [ 'user.name' ] } ); The SQL generated would resemble something like: SELECT me.user_id, user.name FROM acl me JOIN users user ON me.user_id = user.id If, as is likely, your database treats "user" as a reserved word, you'd end up with the following errors: 1) syntax error at or near "." - due to "user.name" in the SELECT clause 2) syntax error at or near "user" - due to "user" in the JOIN clause The solution is to enable quoting - see "Setting_quoting_for_the_generated_SQL" in DBIx::Class::Manual::Cookbook for details. column "foo DESC" does not exist ... This can happen if you are still using the obsolete order hack, and also happen to turn on SQL-quoting. $rs->search( {}, { order_by => [ 'name DESC' ] } ); Since DBIx::Class >= 0.08100 and SQL::Abstract >= 1.50 the above should be written as: $rs->search( {}, { order_by => { -desc => 'name' } } ); For more ways to express order clauses refer to "ORDER_BY_CLAUSES" in SQL::Abstract Perl Performance Issues on Red Hat Systems There is a problem with slow performance of certain DBIx::Class operations using the system perl on some Fedora and Red Hat Enterprise Linux system (as well as their derivative distributions such as Centos, White Box and Scientific Linux). Distributions affected include Fedora 5 through to Fedora 8 and RHEL5 upto and including RHEL5 Update 2. Fedora 9 (which uses perl 5.10) has never been affected - this is purely a perl 5.8.8 issue. As of September 2008 the following packages are known to be fixed and so free of this performance issue (this means all Fedora and RHEL5 systems with full current updates will not be subject to this problem):- Fedora 8 - perl-5.8.8-41.fc8 RHEL5 - perl-5.8.8-15.el5_2.1 This issue is due to perl doing an exhaustive search of blessed objects under certain circumstances. The problem shows up as performance degradation exponential to the number of DBIx::Class row objects in memory, so can be unnoticeable with certain data sets, but with huge performance impacts on other datasets. A pair of tests for susceptibility to the issue and performance effects of the bless/overload problem can be found in the DBIx::Class test suite, in the "t/99rh_perl_perf_bug.t" file. Further information on this issue can be found in <https://bugzilla.redhat.com/show_bug.cgi?id=379791>, <https://bugzilla.redhat.com/show_bug.cgi?id=460308> and http://rhn.redhat.com/errata/RHBA-2008-0876.html <http://rhn.redhat.com/errata/RHBA-2008-0876.html> Excessive Memory Allocation with TEXT/BLOB/etc. Columns and Large LongReadLen It has been observed, using DBD::ODBC, that creating a DBIx::Class::Row object which includes a column of data type TEXT/BLOB/etc. will allocate LongReadLen bytes. This allocation does not leak, but if LongReadLen is large in size, and many such row objects are created, e.g. as the output of a ResultSet query, the memory footprint of the Perl interpreter can grow very large. The solution is to use the smallest practical value for LongReadLen. perl v5.14.2 2010-06-03 DBIx::Class::Manual::Troubleshooting(3pm)
All times are GMT -4. The time now is 11:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy