export PRINTER=lp in bootlocal.sh not working
Forum: Other Help Topics
Topic: export PRINTER=lp in bootlocal.sh not working
started by: jhsu
Posted by jhsu on July 04 2008,05:24I'm having a series of printer problems. I'll focus on just one here. And no, the people on the printer forum weren't able to explain this.
As instructed, I put the command "export PRINTER=lp" in the opt/bootlocal.sh file so that I wouldn't have to type it up manually every time I booted up.
Why does DSL refuse to execute this command when I boot up? I know that it's not being executed, because typing "env" in a shell shows NO "PRINTER=lp" in the output.
The commands I put in opt/powerdown.sh do execute when I power down. So why aren't the commands I put in opt/bootlocal.sh executing as well when i start up?
Posted by Juanito on July 04 2008,05:33Wouldn't you need to put "export PRINTER=lp" somewhere where it would be exported system-wide? .bashrc maybe?
Posted by roberts on July 04 2008,05:50You should put that export in .bash_profile or .bashrc
.bashrc is run everytime you start a shell
.bash_profile is when you login in.
You can see examples of other exports by looking at those two files.
Posted by ^thehatsrule^ on July 04 2008,07:00You know you could just bump your old threads... might be helpful to visit them too - will also explain your questions. Even though bootlocal was initial suggestion, other files (such as the same advice given above) were also given as suggestions. But I guess some things never seem to get done :P
Just to exactly make sure where variables can be propagated from, I just edited a couple files and used the mydsl system in a DSL 4.3 system.
Conclusion: it should work in
fwiw, /etc/bashrc did not work. My guess is that bash.bashrc took precedence.
If you do not know how to edit (any of) these files, do not hesitate to ask.
Posted by jhsu on July 04 2008,16:33Now I'm confused. Is the export command supposed to be in .bash_profile, bash.bashrc, .xinitrc, or .bashrc? Exactly what are these files for? Some of these files are in more than one directory, so which is the appropriate one to edit?
What's the startup mechanism, and why is there so much confusing information? All I want here is to get a certain command to execute AUTOMATICALLY EVERY TIME I boot up.
I'd make the changes right now, but I'm currently in a long download that I can't interrupt right now.
Posted by ^thehatsrule^ on July 04 2008,17:38
Posted by jhsu on July 04 2008,18:08OK, I see that /etc/bashrc is the file. I know this is the file that executes automatically, because I see it contains:
alias which="type -path"
And typing "alias" confirms that these aliases were set.
So how do I edit the file given that I'm not allowed to do so? The file permissions for the file and directory shouldn't be stopping me (full permission provided), so what's the problem?
Posted by ^thehatsrule^ on July 04 2008,18:36
Posted by jhsu on July 04 2008,19:41Why isn't anyone here able to give a straight answer? All I'm trying to do is figure out what file to put the command "export PRINTER=lp" so that it automatically executes every time so I don't have to do it manually. And that's only ONE step of several more steps I need to be able to print without having to go through the setup mumbo jumbo EVERY TIME.
I don't know what you expect me to do. The pdf document on printing leaves out some important details. The book provides even fewer details. Everyone here gives cryptic and incomplete instructions. Does anyone have any idea of what's going on? I'm starting to get the impression that nobody really understands the printing mechanism in DSL but is unwilling to say so.
Posted by ^thehatsrule^ on July 04 2008,20:49OK, I guess being new to a shell environment can be hard at times, but you must realize that the docs, etc. are mostly out-of-sync with the current DSL versions. I won't comment on the rest of your post.
Here's a script to do some implementation that may work. (OK, I'm assuming you know how to use one though). Just off the top of my head though - not tested. And its probably best to run it as root.
Posted by jhsu on July 05 2008,21:31How far back do I need to go for the documentation to work? I thought I was way behind because I'm only using version 3.4.8, but since the documentation isn't keeping up with the changes, I have no choice but to go back to an earlier version so that the documentation is valid.