|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
||||
|
||||
|
Troubles with Shell Script
Hi. I have a problem with my shell script, I used images in my project, all the installation works fine, I copied my project into /usr/bin/ and when I will run my project "couldn't open "filenew.gif": no such file or directory" shows up. Like the link to my project folder doesnt works. What could be the problem?. The link in /usr/bin/ looks fine:
Link Target: /usr/share/PadPaper-EDITOR-1.01/PadPaper.py Part of my Shell Script: Code:
su -c "mkdir -p /usr/share/PadPaper-EDITOR-1.01/ && cp *.py *.gif README COPYING AUTHORS /usr/share/PadPaper-EDITOR-1.01/ && chmod a+x /usr/share/PadPaper-EDITOR-1.01/PadPaper.py && ln -sf /usr/share/PadPaper-EDITOR-1.01/PadPaper.py /usr/bin/PadPaper" Thanks for your help. |
|
#2
|
||||
|
||||
|
What directory does the application think it is running from?
And where are the gif files relative to that location? It sounds like you have a relative addressing problem. Grim |
|
#3
|
||||
|
||||
|
Thanks for your reply. I Attached the Project. The shell script is Install.sh.
|
|
#4
|
|||
|
|||
|
Well, then thing is: What Grim said applies. When you run an application or a script, the current working directory is the base directory from where relative file locations are mapped.
This is to say that: for every file you name with no path, i.e. just the filename, an equivalent way of naming that file would be './file'. The node you are at in the directory structure becomes the base, so if you're in your home folder, a third way of saying the exact same thing would be '~/file'. For me, this would be '/Users/simon/file', with the shell expanding the '~' token. In your PadPaper.py file, you point to the GIF files without any path information. Now you know where Python looks for those files; it ain't in your project folder. |
|
#5
|
||||
|
||||
|
Thanks all for your replys. Now is working fine.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Troubles with Shell Script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|