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 Tue 29 Jul 2014, 03:07
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
need a little help making a script.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message
e-dog
Guest


PostPosted: Thu 13 Oct 2005, 17:56    Post subject:  need a little help making a script.  

Whats up guys? I am trying to make a script do something that might seem strange to you but I think it will be cool when I am all done. I have almost no script making skills but what I am trying to do isn't hard. I place the script into /usr/bin and call it lpr, the script code follows:

cp $1 /print/

simple enough right? all i want it to do is when i want to print someting (anything) it copys the file into the directory /print/ instead of actually printing anything. For some reason it's not working. I can do it but only if im in the /usr/bin directory. I can "lpr (name of file)" and it works fine of course when i am in /usr/bin, but if im at ~/ or something it says "Cant open lpr." Also when I use gui programs like abiword or mozilla i dont know what happens but the file doesnt end up in /print/ when i push the print button.

Any help would be good. thanks.
Back to top
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Thu 13 Oct 2005, 18:53    Post subject:  

Sounds to me like you need to use "/usr/bin/lpr (name of file)" instead of "lpr (name of file)"

Sometimes it just works like that Neutral

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Thu 13 Oct 2005, 20:18    Post subject:  

to see what is happening, try putting this in the /usr/bin/lpr script:
Code:
#!/bin/sh
echo "cp $1 /print/" >> /tmp/lpr.txt
xmessage -center "cp $1 /print/"
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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.0421s ][ Queries: 12 (0.0056s) ][ GZIP on ]