Dear Friends,
Please help me.
How can I pass a parameter from one Shell-script to another Shell-script.
Example:
FirstScript.sh
-------------
./SecondScript.sh 'paramater'
And
SecondScript.sh
---------------
doing something with passed parameter from FirstScript.sh
Please... (2 Replies)
if
then
# mail -s "Import failed file does not exist" sanjay.jaiswal@xyz.com
echo "FILE does not exist"
exit 1
fi
echo "FILE EXIST"
size=-1
set $(du /export/home/oracle/nas/scott21.dmp.gz)
while
do
echo "Inside the loop"
size=$1
set $(du... (1 Reply)
I need to pass a variable as a parameter from shell script into a DB2 database.
var=bhuk_1123_Q_11/22/09
select * from tbl1 where serial_id='$var';
I have tried executing it using
db2 -tvf scriptname
Somebody please help me out with this. It is throwing an error. Please tell me how... (2 Replies)
Hello,
Can anyone guide me tin passing parameters into user defined function of shell script (KSH).
Here is my code,
InsertRecord()
{
DB_TBL=$(sqlplus $USERID/$PASSWORD@$DATABASE << EOF
set head off
set feed off
set serveroutput on
INSERT INTO TBL1 ( OLD_VAL,
NEW_VAL,
... (7 Replies)
Hi All,
I tried googling but so far no luck, can someone tell me how pass the variable value used inside the
nawk command to shell. In the below script i get the value of $c (without color: Total Executed: " c ")
but the printf which is outside the nawk command doesn't print the value or it... (4 Replies)
Discussion started by: Optimus81
4 Replies
7. Post Here to Contact Site Administrators and Moderators
Variable I have in my shell script
diff=$1$2.diff
id=$2
new=new_$diff
echo "My id is $1"
echo "I want to sync for user account $id"
##awk command I am using is as below
cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new
I could see value of $id is not passing to the awk... (0 Replies)
Hi,
I have an XML file like the following...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ONDEMAND_JOB VERSION="5.1" LOCALE="en_US">
<IMPORT_JOBSET TC_CONNECTION_NAME="default" ENVIRONMENT="PRD" USERNAME="Administrator" PASSWORD="AdminPassword" CALENDAR="Main Monthly Calendar"... (2 Replies)
Hi,
I have an XML file like the following...
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ONDEMAND_JOB VERSION="5.1" LOCALE="en_US">
<IMPORT_JOBSET TC_CONNECTION_NAME="default" ENVIRONMENT="PRD" USERNAME="Administrator" PASSWORD="AdminPassword" CALENDAR="Main Monthly Calendar"... (3 Replies)
I have written a script which will take input parameter as another script.
However, if the script passed as input parameter has parameters then this script doesn't work.
I have a script b.ksh which has 1 and 2 as parameters
I have a script c.ksh which has 3,4 and 5 as parameters
vi a.ksh... (1 Reply)
Discussion started by: Vee
1 Replies
LEARN ABOUT DEBIAN
regexp::shellish
Shellish(3pm) User Contributed Perl Documentation Shellish(3pm)NAME
Regexp::Shellish - Shell-like regular expressions
SYNOPSIS
use Regexp::Shellish qw( :all ) ;
$re = compile_shellish( 'a/c*d' ) ;
## This next one's like 'a*d' except that it'll
## match 'a/d'.
$re = compile_shellish( 'a**d' ) ;
## And here '**' won't match 'a/d', but behaves
## like 'a*d', except for the possibility of high
## cpu time consumption.
$re = compile_shellish( 'a**d', { star_star => 0 } ) ;
## The next two result in identical $re1 and $re2.
## The second is a noop so that Regexp references can
## be easily accomodated.
$re1 = compile_shellish( 'a{b,c}d' ) ;
$re2 = compile_shellish( qr/A(?:a(?:b|c)d)/ ) ;
@matches = shellish_glob( $re, @possibilities ) ;
DESCRIPTION
Provides shell-like regular expressions. The wildcards provided are "?", "*" and "**", where "**" is like "*" but matches "/". See "com-
pile_shellish" for details.
Case sensitivity and constructs like <**>, "(a*b)", and "{a,b,c}" can be disabled.
compile_shellish
Compiles a string containing a 'shellish' regular expression, returning a Regexp reference. Regexp references passed in are passed
through unmolested.
Here are the transformation rules from shellish expression terms to perl regular expression terms:
Shellish Perl RE
======== =======
* [^/]*
? .
** .* ## unless { star_star => 0 }
... .* ## unless { dot_dot_dot => 0 }
( ( ## unless { parens => 0 }
) ) ## unless { parens => 0 }
{a,b,c} (?:a|b|c) ## unless { braces => 0 }
a a ## These are de-escaped and
* * ## passed to quotemeta()
The wildcards treat newlines as normal characters.
Parens group in to $1..$n, since they are passed through unmolested (unless option parens => 0 is passed). This is useless when using
glob_shellish(), though.
The final parameter can be a hash reference containing options:
compile_shellish(
'**',
{
anchors => 0, ## Doesn't put ^ and $ around the
## resulting regexp
case_sensitive => 0, ## Make case insensitive
dot_dot_dot => 0, ## '...' is now just three '.' chars
star_star => 0, ## '**' is now two '*' wildcards
parens => 0, ## '(', ')' are now regular chars
braces => 0, ## '{', '}' are now regular chars
}
) ;
No option affects Regexps passed through.
shellish_glob
Pass a regular expression and a list of possible values, get back a list of matching values.
my @matches = shellish_glob( '*/*', @possibilities ) ;
my @matches = shellish_glob( '*/*', @possibilities, \%options ) ;
AUTHOR
Barrie Slaymaker <barries@slaysys.com>
perl v5.8.8 2002-01-24 Shellish(3pm)