I am new to scripting in AIX / UNIX. I have a script that runs 4 other scripts and I want to be able to pass in a agrument that I can check before I run the next script to see if the previous script finished with no errors.
Can someone send me an example of this as I'm sure it's pretty easy to... (1 Reply)
hi I am new to shell programming.....my question is while running one of my shell program it stops in between to accept input from the user and proceeds furthur after giving input....I want to know whether I can set this input through some files so that the shell acript reads the input from the... (10 Replies)
I'm pretty new to bash scripting and I've found myself writing things like this (and the same with even more nesting):
if $CATEGORIES; then
if $LABEL_SLOTS; then
$pyth "$wd/texify_grammar.py" "$input" "$texfile" "--label-slots" "--categories" "$CATEGORY_LIST"
... (9 Replies)
Hello
Please i want to pass parameter (the string s) to the shell script:
Quote:
String s="Hello";
Process process = Runtime.getRuntime().exec("sh script1.sh");
How can i do please?
Thank you (0 Replies)
Semi-newbie, so flame throwers to 'singe-only', please. ;-)
I have a large number of (say) .html files, where I'd like to do a recursive in-place search and replace a particular string. The following bit of perl works fine:
perl -pi -e 's/oldstring/newstring/g' `find ./ -name *.html`
... (2 Replies)
Hi Gurus,
Need some help with the shell scripting here.
#!/bin/ksh
ps -ef | grep -i sample.ksh | grep -v grep > abc.txt
if
then
echo "sample.ksh is executing"
else
echo "sample.ksh is not executing"
fi (1 Reply)
Hi All,
I am using the script for creating local queue and passing the arguments while running the script as below
n=0
while
do
e=`expr $n + 3`
echo 'DEFINE QL('$e') MAXDEPTH('$6') MAXMSGL('$7') DEFPSIST('$8') '$9'' | /apps/mqm_opt/bin/runmqsc $2
n=`expr $n + 1`
done
Running the... (5 Replies)
I found something insteresting when I tested passing arguments into my scripts.
My scripts is as below.
% cat passarg.env
#!/bin/csh
echo "passarg: argv = $argv argv = $argv"
passarg1.env $*
% cat passarg1.env
#!/bin/csh
echo "passarg1: argv = $argv argvp=$argv"
set str = "test... (5 Replies)
Hi All,
I have below simple shell script in cloudera quick start vm cenos 6 which copy file from source to destination.
# file_copy.sh
source_dir = ${source_dir}
target = ${target_dir}
cp source_dir target
and my parameter file is like below
#parameter_file.txt
source_dir =... (4 Replies)
Discussion started by: Narasimhasss
4 Replies
LEARN ABOUT DEBIAN
anyevent::dbd::pg
AnyEvent::DBD::Pg(3pm) User Contributed Perl Documentation AnyEvent::DBD::Pg(3pm)NAME
AnyEvent::DBD::Pg - AnyEvent interface to DBD::Pg's async interface
SYNOPSIS
use AnyEvent::DBD::Pg;
my $adb = AnyEvent::DBD::Pg->new('dbi:Pg:dbname=test', user => 'pass', {
pg_enable_utf8 => 1,
pg_server_prepare => 0,
quote_char => '"',
name_sep => ".",
}, debug => 1);
$adb->queue_size( 4 );
$adb->debug( 1 );
$adb->connect;
$adb->selectcol_arrayref("select pg_sleep( 0.1 ), 1", { Columns => [ 1 ] }, sub {
my $rc = shift or return warn;
my $res = shift;
warn "Got <$adb->{qd}> = $rc / @{$res}";
$adb->selectrow_hashref("select data,* from tx limit 2", {}, sub {
my $rc = shift or return warn;
warn "Got $adb->{qd} = $rc [@_]";
});
});
$adb->execute("update tx set data = data;",sub {
my $rc = shift or return warn;
warn "Got exec: $rc";
#my $st = shift;
#$st->finish;
});
$adb->execute("select from 1",sub {
shift or return warn;
warn "Got $adb->{qd} = @_";
});
$adb->selectrow_array("select pg_sleep( 0.1 ), 2", {}, sub {
shift or return warn;
warn "Got $adb->{qd} = [@_]";
$adb->selectrow_hashref("select * from tx limit 1", {}, sub {
warn "Got $adb->{qd} = [@_]";
$adb->execute("select * from tx", sub {
my $rc = shift or return warn;
my $st = shift;
while(my $row = $st->fetchrow_hashref) { warn "$row->{id}"; }
$st->finish;
exit;
});
});
});
AE::cv->recv;
METHODS
connect()
Establish connection to database
selectrow_array( $query, [\%args], $cb->( $rc, ... ))
Execute PG_ASYNC prepare, than push result of "fetchrow_array" into callback
selectrow_arrayref( $query, [\%args], $cb->( $rc, @row ))
Execute PG_ASYNC prepare, than push result of "fetchrow_arrayref" into callback
selectrow_hashref( $query, [\%args], $cb->( $rc, \%row ))
Execute PG_ASYNC prepare, than push result of "fetchrow_hashref" into callback
selectall_arrayref( $query, [\%args], $cb->( $rc, @rows ))
Execute PG_ASYNC prepare, than push result of "fetchall_arrayref" into callback
selectall_hashref( $query, [\%args], $cb->( $rc, @rows ))
Execute PG_ASYNC prepare, than push result of "fetchall_hashref" into callback
selectcol_arrayref( $query, { Columns => [...], ... }, $cb->( $rc, @rows ))
Execute PG_ASYNC prepare, than push result of "fetchall_hashref($args{Columns})" into callback
execute( $query, [\%args], $cb->( $rc, $sth ))
Execute PG_ASYNC prepare, than invoke callback, pushing resulting sth to it.
Please, note: result already passed as first argument
AUTHOR
Mons Anderson, "<mons@cpan.org>"
LICENSE AND COPYRIGHT
Copyright 2010 Mons Anderson.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as
published by the Free Software Foundation; or the Artistic License.
perl v5.10.1 2010-11-30 AnyEvent::DBD::Pg(3pm)