Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old December 3rd, 2003, 01:19 AM
Gerardoj's Avatar
Gerardoj Gerardoj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Somewhere over the Rainbow
Posts: 128 Gerardoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 54 m 28 sec
Reputation Power: 5
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.

Reply With Quote
  #2  
Old December 3rd, 2003, 06:52 AM
Grim Archon's Avatar
Grim Archon Grim Archon is offline
Mini me.
Dev Shed Novice (500 - 999 posts)
 
Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783 Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)Grim Archon User rank is Corporal (100 - 500 Reputation Level)  Folding Points: 1488 Folding Title: Novice Folder
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 7
Send a message via MSN to Grim Archon
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

Reply With Quote
  #3  
Old December 3rd, 2003, 09:43 AM
Gerardoj's Avatar
Gerardoj Gerardoj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Somewhere over the Rainbow
Posts: 128 Gerardoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 54 m 28 sec
Reputation Power: 5
Thanks for your reply. I Attached the Project. The shell script is Install.sh.
Attached Files
File Type: gz padpaper.tar.gz (26.1 KB, 201 views)

Reply With Quote
  #4  
Old December 3rd, 2003, 10:21 AM
percivall percivall is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 133 percivall User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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.

Reply With Quote
  #5  
Old December 3rd, 2003, 05:47 PM
Gerardoj's Avatar
Gerardoj Gerardoj is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Somewhere over the Rainbow
Posts: 128 Gerardoj User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 54 m 28 sec
Reputation Power: 5
Thanks all for your replys. Now is working fine.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Troubles with Shell Script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway