Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2005, 06:08 AM
kerang kerang is offline
Junior Member
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Bash & Screensaver questions...
Hi guys,

I have 2 questions to ask..

(1) Do i need to install bash to the current pcbsd 0.7? if yes, how can i do that over at pcbsd? anyone care to provide the steps?


(2) Secondly, say i activated the screensaver for 5 minutes option and assume i've left my machines and its over 5 minutes and it is suppose to activate the screensaver.. so my question is can the screensaver sort of be locked with password? meaning once i am to the machine and when i move the mouse while the screensaver was running it should prompt out a password box so does this features available in pcbsd 0.7? anyone care to elaborate? thanks...
Reply With Quote
  #2  
Old 06-10-2005, 06:50 AM
sblevin sblevin is offline
Senior Member
 
Join Date: Jun 2005
Location: Australia
Posts: 909
Thanks: 0
Thanked 0 Times in 0 Posts
Default
(1) Do i need to install bash to the current pcbsd 0.7

Please remember that bash is not a native in PC-BSD land, so think about learning the other shells that come with FreeBSD first - you will need to become familiar with them anyway if you want to get into scripting.

http://www.freebsd.org/doc/en_US.ISO885 ... hells.html

You can install bash by:
1. Connect to the internet
2: Opening Konsole and su to root
3. Type 'pkg_add -r bash'
This will automatically go out, grab the bash package from a trusted site and install and configure it.

Type 'man bash' to read the manual, and type '/usr/local/bin/bash' to invoke it.

I'll do the screensaver one in a minute : )
Reply With Quote
  #3  
Old 06-10-2005, 06:59 AM
Valio Valio is offline
Senior Member
 
Join Date: May 2005
Posts: 287
Thanks: 0
Thanked 0 Times in 0 Posts
Default
2)Seems that there is a bug in the screensaver thing:

http://www.pcbsd.org/forums/viewtopic.p ... creensaver
Reply With Quote
  #4  
Old 06-10-2005, 07:09 AM
sblevin sblevin is offline
Senior Member
 
Join Date: Jun 2005
Location: Australia
Posts: 909
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Right click on the desktop, select 'Configure Desktop' then select 'Screensaver', then click the 'Help Button' and read away. I can't offer a suggestion as my screensaver dosen't start, the screen just goes black even thought the 'Test' button works.

Put a check in the "Require password to stop' box and set this to 1 second if you don't want a little grace period between the screensaver starting and you having to enter a password to stop it.
Reply With Quote
  #5  
Old 06-10-2005, 07:19 AM
kerang kerang is offline
Junior Member
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default
sblevin,
yeah i guess the screensaver should be able to allow users to input password and then when it activates so as when the user is back attending his machine or box when need to access it will prompt for password..
Reply With Quote
  #6  
Old 06-10-2005, 07:31 AM
scottro scottro is offline
Senior Member
 
Join Date: May 2005
Location: NYC
Posts: 360
Thanks: 0
Thanked 0 Times in 0 Posts
Default
There is a pbi for bash. So rather than pkg_add you can use the pcbsd package--6 of one, half a dozen of the other. The advantage to the pkg_add is that it will add bash automatically to /etc/shells

The pbi packages doesn't do that and you will have to manually add a line /usr/local/bin/bash to /etc/shells.

Then, to make it your default shell
Code:
chsh -s /usr/local/bin/bash
PCBSD uses csh by default. That is the default shell for root in FreeBSD. Many people feel that it is a horrible shell for scripting, but this is a matter of personal taste.

Without writing a book, basically it works this way. FreeBSD's csh is actually tcsh which, like bash has history and tab expansion--that is, if you type part of a file name and hit the tab key, it will complete the name for you or give you a list of possibilities.
The sh shell which is closer to bash, doesn't have tab exansion or history with the arrow keys. These are the two shells that ship with the system and are located in /bin. (This can be handy if, for some reason, you can't mount /usr, which is where other shells installed from ports will be.)

Getting curious about this, I once googled to find out why--apparently, the first developers simply preferred the csh shell to the bourne style shells, therefore, the improved csh was chosen as the more advanced shell to be included with the O/S.

NetBSD has these two (though not sure if their csh is tcsh or not). However, NetBSD also has the korn shell, ksh, which is more similar to bash and other Bourne style shells. As of 2.0, their ksh also has tab expansion and history--prior to that, it didn't have them set automatically.

I have to somewhat disagree with sblevin. Depending upon your needs, you don't need to learn scripting with csh, I would say very few people use it for that.

The sh shell IS often used for scripting. The man reason is that it is portable--that is, if I write a bash or my personal favorite, zsh script, then port it to an AIX box running ksh, it might not work. However, if I write a sh script, then just about ever Unix and Unix clone out there has it.

If you're using GNU/Linux, then it's probably safe to stick with bash, but if you go to a different *nix, then you might have portability problems. For example, sh doesn't have the select loop.

I would install bash and use it for my every day work. I'm more familiar with it than I am with csh, and it's simply more convenient for me to use either bash or zsh.

When you are used to tab completion and history, using sh can be annoying--you hit the tab key and it simply advances however many spaces your tab is set to advance. For most things, if, for example, I was in single-user mode and hadn't yet mounted /usr, I would probably use csh, because the FreeBSD version does have tab completion.

For scripting, try to use sh. Sometimes, you need a feature of bash, or another shell, but it will lessen the script's portabilty. Of course we all get into habits. For awhile, I was doing a temperature conversion script with zsh, which handles floating decimals. Bash doesn't.

Then, feeling I would rather use sh, I changed it around--FreeBSD has bc, a math program that handles decimals, as a built in command. However, I then used the program on some Linux distro or another and ran into trouble because they didn't have bc as a builtin command--it had to be installed.

The point being, portability can often be an issue. Many people are used to the Linux seq command. FreeBSD has jot which is similar but not identical.

I think I lost my original point. Anyway, install bash--if you use the pbi, then add it to /etc/shells. Make it your default shell as I described. However, as sblevin says (hrrm, may I call you sb?--it's easier to type) you should become at least passingly familiar with the builtin FreeBSD csh and sh. Become familiar enough with csh to use it in emergencies (at the basic level, that is, if you're not scripting, there aren't too many drastic differences) and familiar with sh if you want to write shell scripts.

(As far as sh goes, the differences are basically the things that bash has that sh doesn't, such as the above-mentioned select loop).
Reply With Quote
  #7  
Old 06-10-2005, 08:07 AM
kerang kerang is offline
Junior Member
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default
hi scottro,

so i can use the steps whom sblevin has propose on it and it will automatically include the bash into the directory right? so do i still need to amend anything on the default shell script as what you've provided me on the coding? Thanks again...
Reply With Quote
  #8  
Old 06-10-2005, 01:28 PM
scottro scottro is offline
Senior Member
 
Join Date: May 2005
Location: NYC
Posts: 360
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Correct, follow sblevin's instructions and it should automatically be added to /etc/shells.

Then do the chsh -s thing that I posted and you should be fine.

If you find yourself really getting into FreeBSD though, don't ignore his advice about becoming a bit familiar with the other shells. Learning a shell is a big thing in itself, but just play with the other shells a bit to be sure you could use them in emergencies (I explained why in my VERY long-winded post above).
Reply With Quote
  #9  
Old 06-13-2005, 03:50 AM
kerang kerang is offline
Junior Member
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default
hi scottro,
thanks man for the valuable feedback..
Reply With Quote
  #10  
Old 06-13-2005, 10:07 AM
zontar zontar is offline
Junior Member
 
Join Date: May 2005
Location: Brisbane AU
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to zontar Send a message via MSN to zontar Send a message via Yahoo to zontar
Default
Scottro,

Thanks for the bit about the shells. There's quite a lot of info there, and I don't think I've seen a similar comparison of the common/popular ones before.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
screensaver issues and flash questions rickdog General Questions 4 10-01-2007 10:01 PM
Cannot run bash script??? krreagan PBI Discussion 5 06-29-2006 02:44 PM
BASH to SH Almindor Creating PC-BSD Packages (.pbi files) 6 12-20-2005 10:08 PM
Bash default? Charles Feature Requests 10 10-21-2005 09:27 AM
bash.pbi doesn't add it to /etc/shells scottro General Bug Reports 0 06-08-2005 11:22 PM


All times are GMT. The time now is 11:15 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.