Results 1 to 3 of 3
Hi,
I have a script below and within this script the following two lines - first line below need to stay the same, and the second line below needs the ...
- 10-13-2011 #1Just Joined!
- Join Date
- Oct 2011
- Posts
- 12
script problem
Hi,
I have a script below and within this script the following two lines - first line below need to stay the same, and the second line below needs the .tar remove. Is there a sed command I can use to remove the .tar from the second line only ?
tar xvf R1_P1000_ABCD_CAL_20101231_Config1C.tar
./Initialize.ksh R1_P1000_ABCD_CAL_20101231_Config1C.tar 20101231
The "R1_P1000_ABCD_CAL_20101231_Config1C.tar" is a variable that I pass into this script below from another script.
thank you
#!/bin/sh
#set -x
################################################## ##############################
#
# Copyright ABC plc 2011
#
# Name: Verify_Install.sh
#
# Version: V0.1
# Date: 12-10-11
#
# Purpose: Verify Install Process
#
################################################## ##############################
#############################################
# Start Verify Intall Processes #
#############################################
Verify_Install()
{
SCRIPTS_DIR=$HOME/Control_Management/scripts
BUILD_DIR=$RELEASE/$CURRENT_CONFIG/Config
PROCESS_DIR=$RELEASE/Scripts/Batch
PACKAGE_CONFIG1C_DIR=$OPS/Project/Release1/Config1C/Dynamic
cd $PACKAGE_CONFIG1C_DIR
tar xvf R1_P1000_ABCD_CAL_20101231_Config1C.tar
cd $PROCESS_DIR
echo "Jobstream Verify_Install Started"
echo " "
./Initialize.ksh R1_P1000_ABCD_CAL_20101231_Config1C.tar 20101231
echo " "
echo "Jobstream Verify_Install completed"
}
- 10-13-2011 #2Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Does this do what you want?
Code:cat script.sh|sed -e 's/^\(\.\/Initialize.ksh.*\)\.tar\(.*\)$/\1\2/'
- 10-13-2011 #3Just Joined!
- Join Date
- Oct 2011
- Posts
- 12
thank you - that has worked perfectly


Reply With Quote