LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-07-2007, 11:57 AM   #1
cragged
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Rep: Reputation: 0
sh error


The following problem does not occur when I run from terminal, but I would like to automate through editor external program calls.

gedit and Texmaker external program calls to metapost work fine, but under certain circumstances (b/etex ) a program, makempx, is called by metapost and I get the error:

sh: makempx: not found

and the required file cannot be made. makempx is in the same /bin folder as mpost which ran in the first place.

This is under Ubuntu Fiesty, TexLive2007, and metapost 1.00 (most recent), required PATH is set in .bashrc and specific configs are set. Again, when I process the file from terminal all goes well.
 
Old 07-08-2007, 01:09 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
If you invoke bash as sh it doesn't check ~/.bashrc
Create a ~/.profile instead.


Cheers,
Tink
 
Old 07-08-2007, 10:10 AM   #3
cragged
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Yes, I went there with trepidation, and added the PATH= ;export $PATH statement:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi

PATH=/usr/local/texlive/2007/bin/i386-linux:$PATH; export PATH

# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi

But this does not help when run from the text editor. It seems something along this line should work but I am not bash proficient, any suggestions?

Remember, no problems at all when run from command line. What appears to be happening is that the text editor establishes its default path for subprograms so while I had pointed it to the original program (metapost) when that program made a subsequent call the path is from the text editor and misleading.

I have corrected by putting:

#!/bin/sh
PATH=/usr/local/texlive/2007/bin/i386-linux:$PATH; export PATH
mpost "$GEDIT_CURRENT_DOCUMENT_NAME"

in the text editor call to metapost. I have yet to find how to change the editor's default PATH settings, and may not need to.

Thanks,
Craggy
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
MPlayer Error Message - Error Opening/Initializing Video Out Device Harpo Linux - Newbie 12 12-30-2009 12:26 AM
Suse CUPS error: cups(File)DoRequest error:client-error-bad-request smdonelan Linux - Hardware 6 04-17-2007 07:46 PM
Error message received from system Error while reading filter description for true Steel_J Linux - Software 2 03-04-2006 07:10 PM
updating new installation of 9.3 ERROR...ERROR...ERROR Morbid SUSE / openSUSE 3 08-16-2005 12:22 AM


All times are GMT -5. The time now is 03:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration