I am using Ubuntu since the version 10.04 and found it more friendly as compared to Windows. Right now I am using ' Precise 12.04`. I have created many custom launchers for bash scripts, and never had any problem until yesterday.
I have installed a software suite which has multiple executables. The main executable abaqus
is located in \opt\softwaresname
and is a symbolic link to the executable abq610i
in /opt/softwaresname/executables/
.
The main exe abaqus
requires some command-line arguments. I use the argument cae
, (i.e. abaqus cae
) but with another command to render the graphics in a better mode, hence the final call is:
XLIB_SKIP_ARGB_VISUALS=1 abaqus cae
I made an alias for this long command in .bash_rc
file as:
alias abaquscae="XLIB_SKIP_ARGB_VISUALS=1 abaqus cae"
Everything worked perfectly fine, as the alias runs the software. Being a lazy champ, I thought of creating a Cairo-dock launcher for this. So I entered abaquscae
in the box "command to launch on click" and checked "Run in a terminal". However to my dismay, upon click the launcher it gave an error::
There was an error creating the child process for this terminal
Failed to execute child process "abaquscae" (No such file or directory)
Consequently I wrote a small bash script file "abaquscae.sh":
#!/bin/sh
"XLIB_SKIP_ARGB_VISUALS=1 abaqus cae"
and saved in, made it executable and upon running it in bash shell I again got the similar error, i.e. :
./abaquscae.sh: 2: ./abaquscae.sh: XLIB_SKIP_ARGB_VISUALS=1 abaqus cae: not found
Now I am totally lost, I have tried many tricks e.g.
1- removing commas in the bash script,
2- making it dos2unix
,
3- using full path to the executable
but this script is not running through bash terminal.
PROBLEM:
The command (as well as its alias) are work fine in the bash terminal, however when they are run through some other channel (e.g. scripts/launchers) the terminal miserably fails to recognize them :( ..
If any expert has advice/information about how to solve this problem, please share. I will be very thankful.
bash
profile. I think the best thing to do is to put your executable script in one of the standard binary folders (like/usr/local/bin
for example), and make sure to put the correct permissions and ownership./usr/local/bin/
, made it executable, and have set the permissions, but the error persists:/usr/local/bin/abaquscae.sh: 2: /usr/local/bin/abaquscae.sh: XLIB_SKIP_ARGB_VISUALS=1 abaqus cae: not found
XLIB_SKIP_ARGB_VISUALS=1
from the script (i.e. just runningabaqus cae
like that from the script)? If it still complains aboutabaqus
, make a symlink to it and put it in/usr/local/bin/
with the right permissions. Good luck!