Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 28 Aug 2014, 01:18
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Script won`t run hidden script, error. [ Solved ]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [12 Posts]  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 20:31    Post subject:  Script won`t run hidden script, error. [ Solved ]  

A script runs another script named ".0", that runs a third script that runs an app. and waits until the app. quits.
When the app quits the third script runs ".0" again to cleanup.

Error when third script tries to run ".0":

sh-4.1# ./Audacious: line 2: 0: command not found

# As you can see by the error, the "." is gone, explaining the failure.
_____ Why would it be removed in the third script, but not in the first?

Audacious script:
Code:
bin/audacious
.0 audacious-3.2.3.sq4


# Audacious script is exec., but has no: #!/bin/sh
_____ It runs the app., but not the hidden exit script.

Command file sequence:
Quote:
Script: Audacious_audacious-3.2.3
__________ Runs command: .0 audacious-3.2.3.sq4 Audacious &

Script: .0
__________ Runs command: Audacious &

Script: Audacious
__________ Runs App., and then runs: .0 audacious-3.2.3.sq4


# audacious-3.2.3.sq4 = Name of SqApp file, and mount point for file.
.

Last edited by sunburnt on Sun 10 Jun 2012, 00:50; edited 1 time in total
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Sat 09 Jun 2012, 20:59    Post subject:  

bash-3.2# echo 'xmessage "HALLO"' > .0
bash-3.2# .0
bash: .0: Kommando nicht gefunden.
bash-3.2# ./.0
bash: ./.0: Permission denied

HTH

[ like ./configure
simply "configure" would also spit out "command not found" in normal circumstances ]
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4341

PostPosted: Sat 09 Jun 2012, 21:21    Post subject:  

same reason you can't execute README.txt, you have to set the executable bit (using chmod etc...)
The easy way is to cp an existing blank script (like the one in templates) and then echo to the copy with >>

even then you need the relative path (unless the directory is in PATH)
thus ./configure

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 22:04    Post subject:  

Hi Karl; The error is: command not found.
But the first script finds it and runs it just fine.

Hi technosaurus; ALL of the exec. bits shown in ROX properties are set.


I said above that the scripts all run, just the third script has a problem.

The two scripts: Audacious_audacious-3.2.3 and .0 have: #!/bin/sh

Audacious does not have it, but "all" exec. properties are set.


As I said, "Audacious_audacious-3.2.3" runs ".0" just fine.
".0" runs "Audacious" fine. But... "Audacious" won`t run ".0".


Doesn`t the missing "." in the error mean something?
If it gets trimmed off then it`s the wrong file and it can`t be found.
That`s the error that is being reported. Correct?

# Note: I forgot to mention that .0 is a link pointing to the real script.
____ But I can`t see that this makes any difference.

.0 is in the path of course. .0 points to a mount/ unmount script

# Should I post all 3 scripts?

Last edited by sunburnt on Sat 09 Jun 2012, 22:12; edited 1 time in total
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Sat 09 Jun 2012, 22:12    Post subject:  

bash has a default PATH buit in, also ash . It is possible to alter it in the source code . bash default PATH does not include /sbin and /usr/sbin i think or bash makes a difference before/after login (su/sudo ye all know) .

[here an example how not to do alter the source code for path to .bashrc :
/etc/bash/.bashrc:/etc/bash/bashrc:/etc/bash/.bashrc.system:/etc/bash/bashrc.system:/etc/.bash/.bashrc:/etc/.bash/bashrc:/etc/.bashrc:/etc/bashrc:/etc/.bashrc.system/etc/bashrc.system Laughing [ only likes one .bashrc , not many] ]

Probably you need a bang line as interpreter so the PATH is known, probably needs a #!/bin/bash --login to parse /etc/profile for PATH is normally in there .

Last edited by Karl Godt on Sat 09 Jun 2012, 22:18; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 22:14    Post subject:  

Karl; Now that makes sense... I`ll try it and let you know.!
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 22:19    Post subject:  

Karl; Nope... Didn`t change a thing. Still the same error.

I left out the shebang to save space as the Audacious file is a hook file.

But it doesn`t make any difference that I can see.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 22:20    Post subject:  

I just thought of a very possible reason.

I`ll be back in a few minutes.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 22:53    Post subject:  

Thank you both sooo very much!

This is a typical example of how I cause my own problems.

Karl gave me a hint talking about the shell path.

I realized that I had not rebooted with the new profile.local I had made.
I had set the path in the VT I was working in.

Then I realize that the path was probably being lost from script to script.
I did not export the path, but the setup didn`t need it with profile.local.

# The .0 script is being run now.




A new error: Can`t unmount the SqApp file, "Device or resource busy".
I figured I had to cd back out of the mount point, but that didn`t help.
I tried sleep 2 to give it time to shutdown, but that also didn`t help.

Something`s still hanging around inside the mount point.

Last edited by sunburnt on Sat 09 Jun 2012, 23:04; edited 2 times in total
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Sat 09 Jun 2012, 22:58    Post subject:  

what says

top

ps

[busybox] fuser -m /mnt/SqApp.sfs

?
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3964
Location: Kiel,Germany

PostPosted: Sat 09 Jun 2012, 23:03    Post subject:  

sunburnt wrote:
Thank you both sooo very much!

This is a typical example of how I cause my own problems.

Karl gave me a hint talking about the shell path.

I realized that I had not rebooted with the new profile.local I had made.
I had set the path in the VT I was working in.

Then I realize that the path was probably being lost from script to script.
I did not export the path, but the setup didn`t need it with profile.local.

# The .0 script is being run now.


A new error: Can`t unmount the SqApp file, "Device or resource busy".
I figured I had to cd back out of the mount point, but that didn`t help.
I tried sleep 2 to give it time to shutdown, but that also didn`t help.

Something`s still hanging around inside the mount point.


Such things happen to me every day Very Happy Laughing

Excuse for not mentioning "export PATH" ..
Back to top
View user's profile Send private message Visit poster's website 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Sat 09 Jun 2012, 23:07    Post subject:  

Quote:
And again with causing myself problems.
The mount script doesn`t mount if the SqApp file`s mounted.
So changes to the script Audacious in the SqApp were not valid.

The Audacious script just needed a & at the end.

bin/audacious
.0 audacious-3.2.3.sq4 &



### An Audacious problem:
Code:
** (process:8063): WARNING **: Desktop file '/opt/SqApp/mnt/audacious-3.2.3.sq4//share/applications/audacious.desktop' has malformed Icon key 'audacious.png'(should not include extension)

There`s 2 // in the path, maybe it`s problem.

I looked at other .desktop files and they all had the extension on the icon.
The error may be in error. The music player seems to work well. Smile
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [12 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0711s ][ Queries: 11 (0.0055s) ][ GZIP on ]