new to FreeBSD but not linux...got a question

I cannot use the tab key to auto complete words like you can in linux. Is there a way in FreeBSD to do that? I'm using the default FreeBSD shell as a normal user. I do not want to switch to the bash shell, id like to keep my experience as close to unix as possible. Just curious if i could get the tab function working under the current shell, CSH.
 
Tab-completion is not a feature of csh, which is why there is tcsh (guess what the 't' is for ..). If you look at 'man csh' (which ends up in 'man tcsh') you can see the differences. Note:

Code:
       Throughout  this  manual,  features  of  tcsh  not found in most csh(1)
       implementations (specifically, the 4.4BSD csh) are labeled with  `(+)',
       and features which are present in csh(1) but not usually documented are
       labeled with `(u)'.
 
Actually in FreeBSD /bin/csh is a hardlink to /bin/tcsh. You can activate completion with the command [cmd=set]autolist[/cmd]. To make this change permanent, add the command to the file ~/.cshrc.
 
That's weird ... tab completion works in here even though autolist is not set ..
Anyways you can still use Ctrl+D to get a list of the possible completions of a word. Take a look at tcsh(1) and look for the "Completion and listing (+)" title for more information.
 
Hey guys, thanks for the help. I did look at the man, apparently I over looked it. If you stare at these screens all the time, everything looks the same!!! lol thanks again.
 
actually guys, that didnt work. the Ctrl+D didnt work neither does adding it to the .cshrc file. I have added set autolist and I even added another alias...nothing worked, i logged out and back in, then I rebooted...still no changes took a affect. any ideas?
 
well, there is no .tcshrc under my home folder. nor is there for root either. is it possible that my shell isnt linked to tcsh?
 
another issue...is that if i had alias to my user .cshrc, nothing happens, but if I add the same alias to roots .cshrc, it works. Also roots .cshrc doesnt even have "set autolist" in the file.
 
i also just discovered (sorry for all the post) that NONE of the aliases that were in my .cshrc file by default work!!!
 
AHHHH! lol I got it fixed.... it would help if my user was under the CSH SHELL!!!! lol WHOOHOO!

just ran chsh -s /bin/csh fixed!!! You guys are crazy..thanks.
 
Just to consolidate the subject here a couple of notes. Maybe it can help out someone who faces the issue in the future.

If you don't have a .cshrc you can just create it by doing:

Code:
$ echo "set autolist" >> ~/.cshrc

Whenever you make changes to your .cshrc file you need to source it, like so:

Code:
$ source ~/.cshrc

To check your assigned shell:

Code:
$ echo $SHELL

To change it (or view the user's current shell) you can use chsh like this:
Code:
$ chsh

And edit the shell path to point to the desired shell. Or in alternative run chsh with the -s argument and specify the new shell like so:

Code:
$ chsh -s tcsh
 
Use bash if you like it, no reason to fear installing it

gentoobob said:
I cannot use the tab key to auto complete words like you can in linux. Is there a way in FreeBSD to do that? I'm using the default FreeBSD shell as a normal user. I do not want to switch to the bash shell, id like to keep my experience as close to unix as possible. Just curious if i could get the tab function working under the current shell, CSH.

For what it's worth, there is nothing "wrong" about installing bash or zsh. They are both far more featureful than the bare-bones "/bin/sh" shell of FreeBSD, and installing them from ports or packages is very easy.

Switching from bash (or another Bourne shell clone) to csh is probably going to be a bit more painful than just installing bash.

Code:
# [b]pkg_add -r bash[/b]

is all it takes to install it, and then you can change your default shell to bash with:

Code:
# [b]chsh -s /usr/local/bin/bash [i]USERNAME[/i][/b]
 
keramida@ said:
For what it's worth, there is nothing "wrong" about installing bash or zsh. They are both far more featureful than the bare-bones "/bin/sh" shell of FreeBSD, and installing them from ports or packages is very easy.

Switching from bash (or another Bourne shell clone) to csh is probably going to be a bit more painful than just installing bash.

Agreed, actually some people have gone so far as to get tab completion for sysctl working with system OIDs under zsh. Every member of the BSD dev team I've met has used zsh as their default shell. I run zsh or bash on all of my production BSD boxes too.
 
If you still want to use tcsh, take a look at shells/tcshrc which has some really ass-kicking settings especially for the command completion.
 
What shell is entered in /etc/passwd for the user?

Code:
test::1002:1002::0:0:test:/home/test:/bin/tcsh
After the last colon you can define the default shell for this user, so you don't need to switch it manually.

mousaka
 
mousaka said:
After the last colon you can define the default shell for this user, so you don't need to switch it manually.

Use the $ chsh command to change a users shell permanently.
 
Back
Top