If you need to import a bunch of transports at os level and the requester asked to check and make sure they are successful with RC =0 or RC =4 else if RC > 4 then stop and inform the requester to confirm
before moving to next transport ..
Action: What you will do in this case ?
I know most of you know how to inlcude in a script and move them just running the script. But this one is little tricky.
You need insert a new command after each import statement to ask you press any key to continue ....that way you can check RC and if its ok then you can move forward
Isn't that awesome ?
How we do it ?
Include the following statement after each line of import statement
read -rsp $'Press enter to continue...\n'
But how you can insert this line if you have say 1000s of transports in your list ?
Here is one vi editor command , you can use while using vi to your script file
:%s/tp\(.*\)/tp\1\rread -rsp $'Press enter to continue...\n'/
Example
tp import <Transport no> <SID> client=<client_no> u128 pf=/usr/sap/trans/bin/<DOMAIN>.PFL
tp import <Transport no> <SID> client=<client_no> u128 pf=/usr/sap/trans/bin/<DOMAIN>.PFL
Now after inserting the line using the vi editor replacement command , it should look like below
tp import <Transport no> <SID> client=<client_no> u128 pf=/usr/sap/trans/bin/<DOMAIN>.PFL
read -rsp $'Press enter to continue...^@'
tp import <Transport no> <SID> client=<client_no> u128 pf=/usr/sap/trans/bin/<DOMAIN>.PFL
read -rsp $'Press enter to continue...^@'
Don't worry about the @ symbol here.
Output when you run the script
VISQHCMAP01:shqadm 170> ./tpimport_SH110_1.sh
This is tp version 380.39.89 (release 742, unicode enabled)
This is R3trans version 6.25 (release 742 - 07.10.15 - 17:42:42).
unicode enabled version
R3trans finished (0000).
tp finished with return code: 0
meaning:
Everything OK
Press enter to continue...This is tp version 380.39.89 (release 742, unicode enabled)
This is R3trans version 6.25 (release 742 - 07.10.15 - 17:42:42).
unicode enabled version
R3trans finished (0000).
tp finished with return code: 0
meaning:
Everything OK
Press enter to continue...
------------------
Hope this will help you all.
Provide your feedback if it helped you.
Thanks
Rabi