- Works:
vsim
,sh -c vsim
- Doesn't work:
echo "vsim" | sh
,echo "vsim" | xargs -I {} sh -c "{}"
I want to run ModelSim (vsim
) with dmenu
, which is triggered using xbindkeys
.
Details
vsim
is a executable for ModelSim, installed in /opt/altera/modelsim_ase/bin
.
When I run it directly, it runs. But when I run it with xargs
(eg. from dmenu), it does not work at all - the script itself launches, but probably in the wrong directory or something, I'm really clueless what's wrong.
My path (I added newlines for clarity):
[ondra@x201 ~]$ echo $PATH
/usr/local/sbin:
/usr/local/bin:
/usr/bin:
/usr/lib/jvm/default/bin:
/usr/bin/site_perl:
/usr/bin/vendor_perl:
/usr/bin/core_perl:
/opt/altera/quartus/bin:
/opt/altera/modelsim_ase/bin:
/home/ondra/bin:
/home/ondra/.gem/ruby/2.1.0/bin:
/opt/altera/University_Program/Monitor_Program/bin/bin
Where is vsim
?
[ondra@x201 ~]$ which vsim
/opt/altera/modelsim_ase/bin/vsim
Run it with xargs
:
[ondra@x201 ~]$ echo "vsim" | xargs -I {} sh -c '{} &'
[ondra@x201 ~]$ Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl
# 10.1d
#
# <EOF>
^C
Run it directly:
[ondra@x201 ~]$ vsim
Reading /opt/altera/modelsim_ase/tcl/vsim/pref.tcl
# --- and modelsim starts fine now ---
Any ideas welcome.
vsim
in this manner. It launches an interactive shell (written in TCL/Tk). What are you trying to do with this? You can find wherevsim
is located on disk like so:type -f vsim
. This feels like an XY Problem, what are you ultimately trying to do withvsim
. I worked w/ modemsim/modeltech for 15+ years, you're doing something you shouldn't be.type -f vsim
isvsim is /opt/altera/modelsim_ase/bin/vsim
. The only thing I want to do is to start modelsim, I think the vsim script does that - and it works when I just go to that folder and do./vsim
. If there's another way, please share.vsim
from any directory? The directory that includesvsim
is in your$PATH
.sh -c "vsim"
, this does not:echo "vsim" | xargs -I {} sh -c "{}"
. So I concluded there's something rotten in the xargs syntax, but couldn't figure out what.