Commit 8ee8993
committed
sap_facts.sh - ps print only executable with path
The output of "ps -ef" not also includes the command but also the
process age and process arguments. Both can have digits in its string
which may interfere when grepping for an instance number like 00 or 01.
To fix this, let ps print only the executable with its path.
Example: ps with default output - 2 lines match where only 1st line should match
/usr/sap/A22/D01/exe/sapstartsrv pf=/usr/sap/A22/SYS/profile/A22_D01_sapa22u01 -D -u a22adm
/usr/sap/A22/ASCS02/exe/sapstartsrv pf=/usr/sap/A22/SYS/profile/A22_ASCS02_sapa22u01 -D -u a22adm
Example: ps with custom layout, only one line matches as expected
/usr/sap/A22/D01/exe/sapstartsrv1 parent e247f47 commit 8ee8993
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
0 commit comments