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 Wed 26 Nov 2014, 20:16
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 Posts_count  
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5042
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.
.

Edited_time_total
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
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_website 
technosaurus


Joined: 18 May 2008
Posts: 4379

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: 5042
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?

Edited_time_total
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
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 .

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
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: 5042
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: 5042
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: 5042
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.

Edited_times_total
Back to top
View user's profile Send_private_message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
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_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3972
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_website 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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