0

I have two files with apparently the same name in a Unix directory. How is this possible? When I used the -b option with ls, it is giving a different name. The duplicate file is automatically created after sap kernel upgrade. The backup of the old kernel of SAP was placed inside PP2 directory before performing the upgrade by creating a separate folder for it. Does anybody know the reason behind this?

Details are as follows:

:xe-s-aspach02345d:/usr/sap#ls -ltr | tail -3
-rw-------    1 root     system         1940 May 19 2018  PP2
drwxr-xr-x   13 pp2adm   sapsys         4096 Oct 26 16:01 PP2
drwxrwxr-x    6 pp2adm   sapsys         4096 Oct 28 04:34 tmp
:xe-s-aspach02345d:/usr/sap#ls -ltrb | tail -3
-rw-------    1 root     system         1940 May 19 2018  PP3\0102
drwxr-xr-x   13 pp2adm   sapsys         4096 Oct 26 16:01 PP2
drwxrwxr-x    6 pp2adm   sapsys         4096 Oct 28 04:34 tmp
:xe-s-aspach02345d:/usr/sap#pwd
/usr/sap
4

The reason that the two files appear to have the same name with ls -l is that one of them has a backspace in its name (\010): thus when ls -l outputs its name, it outputs PP3, then backspace returns the cursor over the 3, then 2 which results in PP2.

You can see this with

printf PP3; sleep 2; printf '\0102'

As to why this happens with SAP, I have no idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.