Ask Your Question
0

CE> /usr/lib64/libreoffice/program/soffice: line 54: dirname: command not found

asked 2018-04-09 04:28:45 +0200

eddiesengola gravatar image

updated 2018-04-09 07:55:43 +0200

Run a java program that uses LibreOffice Java API to convert a doc into pdf file using a Bash script on the Linux terminal and I am getting this error. Any idea how to resolve it?

FYI, Using Eclipse I am able to run the program successfully.

But using a Bash script to run the program on the Linux terminal, I am getting this error below.

CE> /usr/lib64/libreoffice/program/soffice: line 54: dirname: command not found CE> /usr/lib64/libreoffice/program/soffice: line 124: grep: command not found CE> /usr/lib64/libreoffice/program/soffice: line 130: uname: command not found CE> /usr/lib64/libreoffice/program/soffice: line 161: /home/Programs/ACS2CC_Print2PDF_Integration/oosplash: No such file or directory

edit retag flag offensive close merge delete

Comments

Hi Eike,

This time, I used with my own user login account not the root account. Getting the same error. Here is the content of my user login's .bash.profile file.

...................................

Get the aliases and functions

if [ -f ~/.bashrc ]; then . ~/.bashrc fi

User specific environment and startup programs

export PATH

export PATH=/usr/sbin:$PATH

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

export TMP=/tmp export TMPDIR .................................

eddiesengola gravatar imageeddiesengola ( 2018-04-09 23:25:54 +0200 )edit

Eike,

FYI, I installed LibreOffice, using the root account. Thank you again for your help.

Eddie

eddiesengola gravatar imageeddiesengola ( 2018-04-09 23:32:59 +0200 )edit

Eike,

grep is in /usr/bin.

in my login account's .bash_profile, I only set the below, and still getting the same error.

export PATH=/usr/sbin:/bin:/usr/bin

eddiesengola gravatar imageeddiesengola ( 2018-04-10 08:05:36 +0200 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2018-04-09 11:56:34 +0200

erAck gravatar image

updated 2018-04-09 11:59:28 +0200

Make sure your bash shell's PATH environment variable has set /usr/bin and maybe /bin (depends on the distribution which path grep is installed to), so echo $PATH should display at least /usr/bin or maybe /usr/bin:/bin somewhere in the output.

edit flag offensive delete link more
0

answered 2018-04-09 21:53:18 +0200

eddiesengola gravatar image

Hi Eike,

Thanks for the feedback.

I did it as you can see below. /usr/bin is included.

[root@wcserverone# echo $PATH

/usr/lib64/qt3.3/bin:/usr/local/sbin:/usr/sbin:/usr/local/bin:/usr/bin:$PATH:/usr/lib/jvm/jdk1.8.0_92/bin:/usr/lib/jvm/jdk1.8.0_92/jre/bin:/root/bin

edit flag offensive delete link more

Comments

  1. Please don't post comments as answers. It is not an answer to the original question.

  2. You should not run such things as root.

  3. The content containing a literal $PATH string is wrong. Check the script that is assembling that content.

  4. Check that the PATH variable is actually exported and not just local to the script that sets the variable.

erAck gravatar imageerAck ( 2018-04-09 22:15:12 +0200 )edit

Hi EiKe,

Many Thanks for your hints and suggestions.

The issue was that since I was executing my own bash script to run the java program, I had to include in that bash script, the following: /usr/bin/grep:/usr/bin:/bin:/root/bin:usr/bin on the below:

export PATH=${JAVA_HOME}/bin.

So, setting this below in my bash script, did the trick. Never updated my user login account's .bash_profile

export PATH=${JAVA_HOME}/bin:/usr/bin/grep:/usr/bin:/bin:/root/bin:usr/bin

eddiesengola gravatar imageeddiesengola ( 2018-04-10 09:27:37 +0200 )edit

Note that /usr/bin/grep is the executable and thus listing it in PATH is superfluous. And usr/bin (without leading /) at the end looks odd. That adds a usr/bin search path relative to the current work directory (which may even be harmful).

erAck gravatar imageerAck ( 2018-04-12 14:11:36 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-04-09 04:28:45 +0200

Seen: 155 times

Last updated: Apr 09 '18