![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| returning to the parent shell after invoking a script within a script | gurukottur | Shell Programming and Scripting | 5 | 09-26-2006 04:05 AM |
| Invoking Shell Script via php | bubeshj | Shell Programming and Scripting | 2 | 06-30-2006 03:09 AM |
| Invoking shell script from html/jsp page | bubeshj | Shell Programming and Scripting | 2 | 06-28-2006 10:53 AM |
| invoking one shell script from other | ajay xavier | Shell Programming and Scripting | 3 | 05-24-2006 12:39 AM |
| Wrong Shell Invoking My Script On Linux | kowrip | Shell Programming and Scripting | 3 | 09-10-2003 07:18 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Invoking shell script with perl command.
Hi All,
I am using the following command to invoke the shell script from a perl command. Code:
perl -i.bak -pe'BEGIN { $cmd = "/opt/coreservices/tomcat-5.5.9/bin/digest.sh -a sha"; }
s/(password=")([^"]*)/
$1.`$cmd $2|cut -d: -f2|tr -d "\n"`
/e
' $CATALINA_HOME/conf/tomcat-users.xml
Code:
perl -i.bak -pe'BEGIN { $cmd = "$CATALINA_HOME/bin/digest.sh -a sha"; }
s/(password=")([^"]*)/
$1.`$cmd $2|cut -d: -f2|tr -d "\n"`
/e
' $CATALINA_HOME/conf/tomcat-users.xml
Code:
typeset -x MY_VARIABLE=$CATALINA_HOME
perl -i.bak -pe'BEGIN { $cmd = "$MY_VARIABLE"/bin/digest.sh -a; }
s/(password=")([^"]*)/
$1.`$cmd $2|cut -d: -f2|tr -d "\n"`
/e
' $CATALINA_HOME/conf/tomcat-users.xml
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi !
You can get environment variable by through %ENV hash. In your case: Code:
perl -i.bak -pe'BEGIN { $cmd = $ENV{CATALINA_HOME}/bin/digest.sh -a; }
s/(password=")([^"]*)/
$1.`$cmd $2|cut -d: -f2|tr -d "\n"`
/e
' $CATALINA_HOME/conf/tomcat-users.xml
|
|||
| Google The UNIX and Linux Forums |