1

I use the command line from SAP command line system. The direct command xsltproc works. When I use it in a script placed in a directory /usr/sap/trans/command, there is a message "command not found". Here is the script

file="/shared/TQ1/ATA/IN/filelist.txt"
echo "$file second"
echo "param $1"
#find /shared/TQ1/ATA/INTER -type f *.xml > /shared/TQ1/ATA/IN
echo "\n after find"
couc=`date +%y%m%d`
file2=$file
echo "&couc"
echo "`date +%y%m%d%H%M%S%N`"
echo "file2=$file2"
echo "before xsltproc"
xsltproc -o /shared/TQ1/ATA/OUT/integrity.xml /usr/sap/trans/command/ATADecrypt_integrity.xsl /shared/TQ1/ATA/INTER/ataLocalizationXML.xml
echo "after xsltroc"
#echo "\n sortie" 

The variable couc is not affected couc=date +%y%m%d It seems that the script can't access to the system variable date but when I use echo "date +%y%m%d%H%M%S%N" I receive 211003112644437803137 with the script

I call the script with sh /usr/sap/trans/command/myscript.sh or bash /usr/sap/trans/command/myscript.sh

outputfile after execution of script

/shared/TQ1/ATA/IN/filelist.txt
 second
                                                                                                                                                                                                                       param 
/shared/TQ1/ATA/INTER/ataLocalizationXML.xml
                                                                                                                                                                                                            \n after find
                                                                                                                                                                                                                                                 &couc
                                                                                                                                                                                                                                                         
211003125447931677292
                                                                                                                                                                                                                                         file2
=/shared/TQ1/ATA/IN/filelist.txt


                                                                                                                                                                                                                       before xsltproc
                                                                                                                                                                                                                                               warning: failed 
to load external entity "/shared/TQ1/ATA/INTER/ataLocalizationXML.xml
"                                                                                                                                                                        unable to parse /shared/TQ1/ATA/INTER/ataLocalizationXML.xml
                                                                                                                                                                                                  after xsltroc

Be careful. Check the result of the all the file (to right of the screen).

3
  • It would be helpful if you would cut & paste the exact output of a run of your script into the question. Along with the exact command used to run the script to produce that output. Commented Oct 3, 2021 at 12:11
  • I added the file of output in the post. Be careful, the output is like that because that comes from SAP interface, but that is the OS linux which reply that Commented Oct 3, 2021 at 13:06
  • The error reported in that output is a failure to parse /shared/TQ1/ATA/INTER/ataLocalizationXML.xml (as XML). It is possible that some higher-level component that attempts to run the script reports that incorrectly as "command not found", but that does not appear to be the root problem. Commented Oct 3, 2021 at 15:03

2 Answers 2

8

xsltproc: XSLT 1.0 command line processor

XSLT is an XML language for defining transformations of XML files from XML to some other arbitrary format, such as XML, HTML, plain text, etc. using standard XSLT version 1.0 stylesheets. This package contains a command line tool that facilitates XSLT transformations.

Install the xsltproc package to get rid of the error "xsltproc not found". Installation instructions differ depending on one's operating system, but here are some examples:

  • Debian/Ubuntu/apt-based apt-get install xsltproc
  • Alpine apk add libxslt
  • Arch Linux pacman -S libxslt
  • CentOS yum install libxslt
  • Fedora dnf install libxslt
  • OS X brew install libxslt
  • Docker docker run cmd.cat/xsltproc xsltproc
Sign up to request clarification or add additional context in comments.

Comments

0

About the Command not found error, that means that the xsltproc file was not found in the execution of the script via the PATH environment variable, please update your script to use the full PATH of the xsltproc file.

# Please run the following command to the the full PATH then adjust your script and let us know the result.
$ which xsltproc

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.