The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   Installing Fink and Bash (http://hintsforums.macworld.com/showthread.php?t=4882)

vickishome 08-23-2002 04:00 PM

Installing Fink and Bash
 
A while back, Merv offered me the excellent suggestion of switching to bash as my Unix shell. I believe I'm ready to make that switch. I'm fully backed up and ready to get started.

I don't know where to start, but here's what I found. I believe I'm supposed to install Fink which I can find here:

http://fink.sourceforge.net/download/index.php

And then I'm supposed to somehow use Fink to install bash which I found on this page:

http://fink.sourceforge.net/pdb/package.php/bash

Is there anything special I should do or know about before I get started?

Jacques 08-23-2002 04:10 PM

Did you already search these forums for FINK threads? Tons of great advise and guidelines have already been posted..

--

You'll be surprised how straight-forward FINK is, nice project.. will you be installing it on a Jaguar-equiped Mac?

bakaDeshi 08-23-2002 04:38 PM

Yes, many previous threads...

After you get Fink installed, you can use Fink Commander which is a gui front for fink.

But knowing you, you'll opt for the command line. :p

sao 08-23-2002 04:39 PM

vickishome,

You can also install Bash without Fink. It will probably be easier for you. You can download from here:

http://www.savagetranscendental.com/tip3.html

But if you want to give it a try and install it with Fink, I would like to know the same question Jacques asked you.

What's your system configuration:

What OS version? ('sw_vers')
What version of make? ('make -v')
What version of the dev tools? ('cc -v')

And I would recommend at least you read a little bit about Fink before you start. Please check the following pages:

http://fink.sourceforge.net/faq/index.php
http://fink.sourceforge.net/doc/users-guide/index.php
http://fink.sourceforge.net/doc/x11/index.php


Cheers...

vickishome 08-23-2002 04:52 PM

My apologies, I did not search the forums. :( I was so anxious to get started, I was hoping someone would say just download Fink, read the instructions, and I'd be on my way. I will go back and run the proper searches.
Quote:

But knowing you, you'll opt for the command line.
Sounds good to me. :p
Quote:

You can also install Bash without Fink. It will probably be easier for you.
So why install Fink? I guess I should try to find out the merrits of installing Fink. Looks like I may have to wait before installing anything as this will take more time to investigate. That'll teach me to get in a hurry. :(

Regarding my setup:
Code:

% sw_vers
ProductName:    Mac OS X
ProductVersion: 10.1.5
BuildVersion:  5S66

% make -v
GNU Make version 3.79, by Richard Stallman and Roland McGrath.
Built for powerpc-apple-darwin1.4
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Report bugs to <bug-make@gnu.org>.

% fink --version

OK? find --version? n
fink: Command not found.

% cc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-934.3, based on gcc version 2.95.2 19991024 (release)


sao 08-23-2002 04:59 PM

vickishome,

To give you an idea of how Fink works:

Using Fink to install packages
You can choose between two installing models:

1-Pre-compiled binary packages

2-The source distribution


1-Pre-compiled binary packages:

When you install a binary package what you get is a ready to run program, saving you the time for compiling.

The Tools used to install pre-compiled binary packages are:

apt-get and dselect

(written by and for the Debian GNU/Linux project)

Apt-get or dselect only know about packages available as precompiled binary packages.

The binary distribution of Fink uses the .deb package format.

The packages are tailor-made for Mac OS X / Darwin and don't use the Debian source package format.


2-The source distribution:

To install packages from source with Fink, you need the Apple Developer Tools installed. After you register for free, you can get them from the:

Apple Developer Connection

If you install from source you have the advantage to usually get newer software. You get to test the latest packages, and as Fink is a volunteer effort, you can then provide feedback through the fink mailing lists and report both success and failure to the package maintainer.

When you buy commercial software you don't get to see the source code (companies treat it as a trade secret).

With Open Source software, the source code is open for anyone to see and modify.

With Fink, you can install packages from source, using its own tool named 'fink'.

So, if you run in terminal:

fink install 'packagename'

Fink will figure out what dependencies are involved, ask if you would like to install them too, then after you say 'Yes' it'll download everything.

For each package, it will unpack it, apply any needed patches, auto-configure, compile, test, and install into a .deb file which gets installed for you by dpkg.

Compared to binary installs (which generally skip to the dpkg step[s]), it's a slow process -- but it can be much more reliable in many cases.

Well that's all for the moment, it's late in Sing and I'm going to sleep. See you tomorrow.


Cheers...

Jacques 08-23-2002 05:04 PM

If you are letting the cat in any time soon, check out this jubilee..

sao 08-23-2002 05:10 PM

vickishome,

Thanks for the info.

Well, Fink needs a little bit of homework, to get you going.

But it can be very rewarding, as it currently lists in its database 1107 packages in 22 sections you could install, including the unstable tree and the latest packages from CVS (as 8-23-02). All for free.

I'll see you tomorrow, as I'm quite sleepy already.


Cheers...

PS: Yes, and as Jacques suggested, if you wait a little and install Jaguar soon, you will get Bash with the System installation.

osxpez 08-23-2002 05:15 PM

Don't make it any harder than it is. Just install Fink and then do:

% sudo apt-get install bash

And be done with it. No need to be fully backed up or anything. =)

I think i installed bash before I installed Fink, but you'll find Fink worth the while anyway. But avoid the "fink" command and stick with apt-get and dselect. You'll get tons of advice in these forums to do fink this and fink that. Disregard them all and remember I told you to stick with apt-get and dselect. I only use fink to get the list of available packages. But I tend to use dselect more and more. Do:

$ sudo apt-get update

often (this will update your list of available packages). And:

$ sudo apt-get upgrade

now and then (this will upgrade your installed packages).

When you do "fink list" you'll see in the first column of the list wether the package is installed or not. dselect gives more information on each package.

Someone posted a hint in one of these forums about a book called "Fun with Fink" or some such. Buy that book, or at least follow the link in that post and get the PDF version of the book.

Why install Fink? Because it opens the door to lots and lots of good, quality, free software. You can get "vim-nox" (nox stands for "No X" which means the terminal only version) that way, as well as "surfraw", "gawk" and you name it!

sao 08-23-2002 05:37 PM

osxpez,

Jejeje.
Quote:

You'll get tons of advice in these forums to do fink this and fink that. Disregard them all...
Well, I will follow your advice then and the first advice to disregard will be yours. :)

A bit too much don't you think? radical statements...

A bit dictatorial: "Only listen to me! and remember I told you to do so!

Different people have different experiences, so why you are so stubborn with yours? Lunch was no good today?

I think apt-get and dselect are wonderful tools and I have used them a lot, but installing from source is also very rewarding.

Statement that came from a newbie about dselect in another forum:
Quote:

The dselect UI is not good. NOT because it is a terminal app - I don't believe terminal apps are a bad thing at all - I just think it can be very confusing to non *nix users.
Many beginners have trouble understanding dselect. This doesn't mean is a bad tool.

So relax osxpez, I will never stop you saying to people to use apt-get or dselect, but just do your statements it in a more civilized way. You are not a dictator.

Now really, good night....zzz


Cheers...

[edit: readability -mt]

osxpez 08-23-2002 05:59 PM

Relax sao. I meant what I said. I think most users should avoid installing with the fink command. And I know by experience that Vicki will be adviced otherwise in these forums. I don't think I was being rude. If you took it like that I appologise. It wasn't meant that way. Perhaps I wasn't clear enough about dselect and apt-get:

I almost always install things with apt-get. I use dselect to read information about and search for packages. Yes, dselect has a quirky inteface. That's why I think "Fun wit Fink" is required reading.

vickishome 08-23-2002 06:19 PM

Alright guys, no fighting. While I may be inexperienced with these particular tools, I'm a big enough girl to make my own decisions (and mistakes!). After all, it's only a computer. :) And I have a full, bootable backup to fall back on. :) I appreciate hearing from all sides of the fence because that offers me more info from which I can base my own decision.

Clearly, there are options available to me that I know so little about that I don't know which options might be the best "fit" for me. I'll muddle along anyway. :p

Regarding Jag... I'm not ready to install Jag. I'm waiting for "issues" surrounding Jag's newness to be resolved. Some people love working with new software; others do not. I fit the "do not" category. I'll upgrade only after you guys carve out a path to make most things work with Jag and when most software venders have upgraded their software to be Jag compatible.
Quote:

If you install from source you have the advantage to usually get newer software. You get to test the latest packages, and as Fink is a volunteer effort, you can then provide feedback through the fink mailing lists and report both success and failure to the package maintainer.
I think you already know where I'm headed with this. ;) I'm too new and too inexperienced to be concerned with the latest and greatest. I wouldn't know a great new feature if it bit me on my nose! I first need to learn the great old features. And I don't think I'd be a good person to be reporting failures with a new feature because the failures would most likely be my own "pilot error". I barely know what grep is. :p What I believe I need most at this point is to get bash on my HD and start playing with it.

Since I'm not hearing a bunch of comments about saving config files or fiddling with environments or anything like that, then I'm just going to jump off the deep end and download/install Fink. From there, I'll figure out how to get bash. If I totally screw up, I can always wipe out my drive and restore from my backup. :)

Wish me luck! And I hope you guys won't hold my "stubborness" against me when I come running for help after screwing it all up! :D

osxpez 08-23-2002 06:35 PM

Stubborness is what will make you prevail with your quest to bend Unix your way. :) Like I said earlier, it's no big deal installing fink and then using apt-get to install bash. Please read the apt-get man page carefully before going ahead using it.

vickishome 08-23-2002 06:39 PM

Fink's installed, and I'm selecting my first packages. I'm reading as I go (actually printing the instructions) and selecting the defaults. I'm pretty much clueless of what I'm doing other than just following the instructions it offers. I'll see soon enough what this does. :)

vickishome 08-23-2002 06:52 PM

Code:

% fink --version
Package manager version: 0.9.12
Distribution version: 0.4.0

Fink's installed! :D

Now to figure out how to get bash.

vickishome 08-23-2002 07:53 PM

Code:

bash-2.05$ ps
  PID  TT  STAT      TIME COMMAND
  721 std  Ss    0:00.03 -bash (bash)
bash-2.05$

Bash is installed! :D And I managed to get it set up as my default (terminal preferences). Now I need to figure out how to get my pretty prompt back, where to set up my aliases and who knows what else. Bash didn't come with a slick readme file so I'm a bit lost right now. Searches on this board and on Google leave me confused. I don't know half of what they're talking about. But I least I can play with bash so I can begin to learn it. I'll eventually figure my way around. :)

mervTormel 08-23-2002 08:08 PM

well done.

you don't need bash to be your default shell yet. so go ahead and change it back to tcsh.

when you want to play in bash, you can start a bash subshell or login shell from tcsh in a new terminal window...
Code:

tcsh% bash    # subshell

bash$ exit    # to return to parent shell

tcsh% bash --login    # test your startup scripts ~/.bash_*
Fri 23 Aug 2002 @ 17:02:06 PDT
...

bash$ # edit startup scriptage, exit, lather rinse repeat

this way, you can work at getting your bash environment set up and tested, while having your comfortable tcsh still underneath.

vickishome 08-23-2002 08:29 PM

Thanks, Merv. I switched back to tcsh for now.

What I need to know is where to begin to set up my bash environment. I'm reading about editing my .profile file which I can't find. And editing my ~/.bashrc file which, apparently, I need to create (what if I want my environment for all users, not just me?). One source said to look at /usr/share/doc/bash/examples/startup-files for examples, but I neither have the dir nor the file itself. I don't even know where to begin to find what config files run when I start bash.

Confusion abounds. :confused:

One thing that would be helpful is a list of the config files that run when bash first starts. I might be able to pick out simple things like the prompt and aliases. Where do I find that info? I learned about it here for tsch, and I have edited those files with echo commands so I can see what runs when, but I haven't found a source to list the files for bash.

Or to cut to the chase...

HELP! :D

mervTormel 08-23-2002 08:47 PM

Code:

% man bash
...
/startup

# or

/INVOCATION
...

# here's a sample bash startup file listing...

% ls -l ~/.bash*
-rw-------  1 merv  wheel  4262 Aug 16 06:15 .bash_aliases
-rw-------  1 merv  wheel    191 Jul 19 13:12 .bash_cdvars
-rw-------  1 merv  wheel    155 Jul 22 15:32 .bash_completion
-rw-------  1 merv  wheel  20702 Aug 23 17:02 .bash_history
-rw-------  1 merv  wheel    38 May 26 01:23 .bash_logout
-rw-------  1 merv  wheel  1783 Aug 21 23:23 .bash_profile
-rw-------  1 merv  wheel  1512 Aug 21 23:22 .bashrc

get get familiar with the startup baloney, then you can make it global or distributable.

N.B. : .bash_history is self-generating

i'll send you a package. it will be ticking.

vickishome 08-23-2002 09:06 PM

/INVOCATION <-- Thank you! :D Now I have something to work with. :)

Jacques 08-24-2002 12:24 AM

BASH Crumbs
 
I still haven't gathered particular portions - umm, why BASH anyhow?

Can someone point me to the thread or link that really started this BASHing?

Do most of you UN*X folk prefer BASH over the default Mac OS X shell? Why or why not?

vickishome 08-24-2002 12:43 AM

I considered that very same question a couple of weeks ago. Here's a couple of links you may want to check out:

http://www.mars.org/home/rob/docs/csh-whynot.html

http://docs.rinet.ru:8080/UNIXs/ch13.htm

Note that bash is an acronym for Bourne Again Shell.

I spent several hours rummaging through other links I found on Google, and I read the comments from others on Google Groups. Further, I have a friend who is a highly regarded consultant who knows Unix inside and out. He also blessed my switch from tcsh to bash.

What's interesting is that I've actually found even more references to bash being preferred since I made my decision to switch than when I was actively hunting for info. Unfortunately, since my decision was already made, I didn't keep track of the urls.

But I think what really hit home for me was that while I could find numerous references recommending bash over tcsh, I did not find one single recommendation for tcsh over bash. Not even one. I thought that was most telling of all.

I'm sure others with more experience can offer a more detailed reason for switching. But I highly recommend doing you own research on the web as well. Once you've looked into it, I think you'll find yourself wanting to install bash too.

sao 08-24-2002 02:11 AM

Vickishome,

After a good night sleep, I 'm back again.

It is great to know you have installed Fink and Bash successfully.

MervTormel advices on bash are the best to come around to the forums.

You're in good hands!

Sorry if you sensed a bit of bickering in the air between osxpez posts and mine.

My intention was to give you some information on how Fink works.

Intended for now and the future. Never suggested to you to do this way or the other exclusively.

Hope you enjoy bashing and the new toy (Fink).


Cheers...

sao 08-24-2002 02:31 AM

osxpez,

awk.....awk......awk....................awkkkk. :D


Cheers...


PS: ..........awk.......!!! :)

sao 08-24-2002 03:59 AM

osxpez,

now seriously..........you said:
Quote:

I think most users should avoid installing with the fink command.
I maybe would understand this advice for beginners, but for 'most users' as you said, I ask myself why?

The tool that Fink has for installing from source ('fink') is a wonderful tool. Extremely reliable and well done and executed.

What's your particular problem with this tool?

Is it because it isn't a Linux tool? I really don't know what your problem is.

I am eager to know, because if it is as bad as you suggest, maybe we should tell everybody, even to the Fink developers, so they can throw it away and doesn't cause more harm.

Please elaborate.

Sincerely...


Cheers...

osxpez 08-24-2002 05:20 AM

Quote:

Originally posted by sao
I maybe would understand this advice for beginners, but for 'most users' as you said, I ask myself why?
Because I think most users will stay in the state of relative ignorance about the mechanics of compilation and stuff so that they will have trouble to cope with the problems that can arrive when using the fink command. Most users probably will not be ready to put enough efforts into helping out testing the packages to be of much use for the Fink team either. apt-get just gives Joe user less trouble than fink I think.

Quote:

Originally posted by sao
even to the Fink developers, so they can throw it away and doesn't cause more harm.
No, please don't do that. I totally agree with you that fink is a great peace of software. It has obviously helped the whole Fink distribution to move extremely fast in getting those binary packages out. I'll just ask for a disclaimer telling Joe user to stick to apt-get most of the time and only use fink when there's a compelling reason and the user understands that reason.

Note that I consider myself to be one of those Joe users. Possibly in the more Unix-knowledgable half, but anyway. I have so far never had a need to move outside apt-get in my more than a year together with OS X. But I didn't know that at first and started out with "fink" which mostly went well, if slow, but a few times things refused to install and I spent days struggling with it. Then someone told me about apt-get and it felt like coming home. I just wished someone had told me about apt-get to begin with.

As for my preferences when it comes to Linux; I think GNU/Linux is great as a server OS, especially Debian. But on the desktop Linux sucks ass. You have to really and badly want to work with it. And even so there's zilch, zero, nada consistency in the GUI (or I should say GUIs because there are plenty in the same environment). OS X is king! And with Fink, no sane and, knowledgable enough, person wanting a Desktop Unix could ever choose Linux over OS X. The $100 or so it costs is way worth it. Not until the Linux community does something like Aqua will Linux ever catch up on Joe users desktops. I fully and completely adore the Fink developers. They are my heroes.

AKcrab 08-24-2002 05:30 AM

I downloaded, installed, configured fink once. I wanted some silly package, don't even remember what it was, but it recommended or required fink...
If someone would have offered me a built-in unixy method, I believe I would have taken it.
I'm still not even sure why I needed fink, as I've installed other packages successfully without it.

So Sao, why are you such a staunch supporter of fink? Can't install a package without it?

osxpez 08-24-2002 05:40 AM

On the tcsh vs bash subject. Though I think I have often said this. :) tcsh was a revolution to interactive shells when it arrived. But with it's csh heritage tcsh as a scripting tool pretty much sucks. ksh was the king of shell scripting back then. The developers of bash tried (and succeeded) to combine the power of the tcsh as an interactive shell (cloning much of it's features) with the scripting power of ksh. That leaves pretty few reasons to stick with tcsh I would say. Since bash other ksh derived shells has arrived as well, like zsh which is part of OS X 10.1 vanilla install. From what I heard zsh is at least as good as bash and adding interactive features at that.

I can see only one reason for some OS X'ers to stick to tcsh as their default shell. Because Apple insists on being stupid about tcsh and shipping OS X with tcsh as the default shell. Quite often you see install instructions and README's and stuff showing how to set up your environment, but only tcsh examples. So you have to know some tcsh and some bash to be able to translate those instructions to your bash environment. But it's not reason enough since it's quite a small obstacle.

sao 08-24-2002 06:12 AM

osxpez,

I agree with you in 99% of what you said.

Except, that if all users would be using apt-get and dselect only, the precompiled binary packages you enjoy now, the ones you are so happy to have installed in the last year with apt-get and dselect, will be much less in quantity and supply as they will be longer sleeping in the unstable branch.

So it works in your own interest really to promote the use of 'fink, the tool', not for all users, or the avarage Joe or Bob, but as an 'option' that users can consider.

Fink is a volunteer effort.

It is because of efforts from average users, together with the Fink developers, that you can enjoy the binary packages you are using now.

As this is the only way, by testing, that packages can get out of unstable and be made into precompiled binaries. The ones you love to install.

And you seem to have quite some experience like you said in the unix side of things:
Quote:

you wrote:
I fully and completely adore the Fink developers. They are my heroes.
So, as John F. Kennedy once said:

"Think not about what your country can do for you, but what you can do for your country"

With all your experience osxpez, what about testing some packages, to help the people you adore so much...your heroes.

The ball is with you, and the tools too.


Cheers...

sao 08-24-2002 06:17 AM

AKcrab,

What do you want?

Both osxpez and me agree 100% that Fink and the tools of Fink -apt-get, dselect, dpkg and fink are great.

So what's your problem?

I fail to understand.

You want to have a go?

If so, please, elaborate.


Cheers...

beus 08-24-2002 06:31 AM

AKcrab,

There are many threads in this Forum outlining the benefits of Fink (by Sao, MervTormel, osxpez, and others), not to mention numerous other sites you can visit. If you study a little you can discover, at the very least, why others find it such a useful tool. If you still feel it does not work for you, you are certainly entitled to your opinion, but I feel your comments have an overly negative tone which seems entirely out of place.

What's the matter...you can't install a package with Fink? ;)

beus

osxpez 08-24-2002 06:49 AM

Vicki: If you can live just a few days without your fancy tcsh prompt I think you can stay with bash as your default shell. You ask some very good questions and point out some of the more ugly parts of environment management. The main being "what should go where?" and "how does it matter?". Even professional Unix distributers sometimes don't know! I once had a freshly installed Mandrake Linux 7.x and it was evident that the Mandrake team had not succeeded in getting this right. I have a working setup on my OS X though and can share it and you can see if it helps any.

I have a symbolic link looking like this:

/bin/bash -> /sw/bin/bash

I'm not sure if Fink did this for me but if you don't have that link you can do:

$ ln -s /sw/bin/bash /bin/bash

Now for what goeas where and why. Not that I'm very good at it, but the bash man page tells us that an interactive login bash shell starts out with reading /etc/profile then goes on to read any ~/.bash_profile (I'm allowing myself to simplify it some). An interactive non-login shell starts with reading ~/.bashrc. (~/ means your home directory). Typically a non-interactive shell inherits it's environment variables from the parent shell so there's no need to but much environment variable setting in any bashrc file. The idea (I think) is to put aliases and functions and stuff into the bashrc files. Still with me? Good. Let's look at my startup files then. :) In the order of their execution as statet by "man bash".

Code:

$ cat /etc/profile
# system profile for sh shells
umask 002

(umask 002 makes me automatically create files that are readable by everybody and writable by me and users in my group while. I'm not sure if this was the default, but it's a sane setting I think.)

Code:

$ cat ~/.bash_profile
# .bash_profile

. /sw/bin/init.sh

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""

export USERNAME BASH_ENV PATH
export PAGER=less

The ". /sw/bin/init.sh" is there because Fink either put it there or told me to put it there. I have not tampered with that init.sh file. The command tells bash to "source" that init.sh file which means setting any enviroment variables and defining any functions and aliases in those files. This is different from just executing /sw/bin/init.sh which would not touch your environment at all. Dot (.) is the bash command for "source". I also source ~/.bashrc here since bash won't do that for login shells. Then some environment variables. (I can really recommend the last one, search this forums for a discussion about it.)

I think it's a quite vanilla ~/.bash_profile, but don't remember how (if) it differs from the original one.

So this means that my login shell does source ~/.bashrc which looks like this:
Code:

$ cat ~/.bashrc
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

alias ls='ls --color=auto'

stty erase '^?'

It starts out with sourcing /etc/bashrc and then defines an alias giving me colored output from ls (you need to "sudo apt-get install fileutils" to get this to work). The stty command there I need because my backspace key deletes the wrong characters otherwise (there's some threads in these Forums about that as well). You might not need it.

Let's move on:
Code:

$ cat /etc/bashrc
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# are we an interactive shell?
if [ "$PS1" ]; then
    if [ -x /usr/bin/tput ]; then
      if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
        stty erase `tput kbs`
      fi
    fi
    case $TERM in
        xterm*)
            PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
            ;;
        *)
            ;;
    esac
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

    if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
        for i in /etc/profile.d/*.sh; do
            if [ -x $i ]; then
                . $i
            fi
        done
    fi
fi

# Falesafe
alias rm='rm -i'

Which sets up my prompt and (HEY! There's probably the stty command that *****s up my backspace key!) stuff. I haven't tampered with it much. What I seem to recall is moving stuff around to centralize stuff. The last loop makes it so that i can put .sh files in /etc/profile.d/ and have them sourced as well. A good way to communicate what's going on. I could put a file there called /etc/profile.d/aliases.sh and centralize all my aliases. I don't use it currently since, as you can see, I have a rather minimalistic set of aliases and environment variables and stuff. By experience I have found that the "alias rm=rm -i" can save trouble. Do "man rm" if you're interested.

With this set up I can put all environment variables that should be used for all users in /etc/profile and all aliases and functions that should be used by all users in /etc/bashrc. Any PEZ local stuff I put in ~/.bash_profile and ~/.bashrc.

You can make backup copies of any versions of these files you have and then try my setup. Also you can post your ~/.login and ~/.tcshrc and what have you and people here can try help you mimic your prompt and aliases.

osxpez 08-24-2002 07:04 AM

Quote:

Originally posted by sao
I agree with you in 99% of what you said.

Except, that if all users would be using apt-get and dselect only, the precompiled binary packages you enjoy now, the ones you are so happy to have installed in the last year with apt-get and dselect, will be much less in quantity and supply as they will be longer sleeping in the unstable branch.
That actually makes it 100% because I never said all usres. I said most users. One thing about me is that I always try to be exact when I way something. :)

Quote:

Originally posted by sao
With all your experience osxpez, what about testing some packages, to help the people you adore so much...your heroes.
I'm affraid I would only mess things up since the occasions when I have this much spare time as at the moment are rare and I wouldn't have time to give any valuable feedback. When I get the time I tend to try to use it to help people getting to know the marvels of Unix. That's my quest. I love Unix.

sao 08-24-2002 08:32 AM

osxpez,

To be exact and precise, the following hardly seems a statement for 'most' users, but in the contrary, for all users who read it.

Quote:

osxpez wrote:
But avoid the "fink" command and stick with apt-get and dselect. You'll get tons of advice in these forums to do fink this and fink that. Disregard them all and remember I told you to stick with apt-get and dselect. I only use fink to get the list of available packages.
Quote:

I'm affraid I would only mess things up since the occasions when I have this much spare time as at the moment are rare and I wouldn't have time to give any valuable feedback. When I get the time I tend to try to use it to help people getting to know the marvels of Unix. That's my quest. I love Unix.
Oh, come on, only excuses...rhetoric.

You can easily leave your terminal or several running in the back installing and still you could give advice about your unix love. I do it all the time.

Anyhow, let's leave it at that. Sorry to have bothered you, and have a happy time using what you take from Fink and giving your good advices. I personally learned a lot from your bash post above.


Cheers...

rusto 08-24-2002 10:57 AM

Vicki,

Here's an in depth page (with many examples) on the Bash prompt:

http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/

Here's the one I currently use (Teminal set to black background, white text):

Code:

PS1="\[\033[1;33m\][\@][\u:\w]\[\033[0m\]\n\$ "
The feature I like best of this prompt is that "\n" near the end which puts the "$" on a new line so that if the path displayed in the prompt gets really long, I always have a fresh line to enter commands on.

vickishome 08-24-2002 11:18 AM

osxpez, thank you for sharing your config files! Merv gave me his config files last night, but it was late and I was blurry-eyed so I just plopped them into my ~ dir and let it go at that. I'm going to copy your config files as well which will give me two examples of each file to work with. My first real Unix goal is to learn enough to comprehend what's in each set of config files so that I can edit them to only include what works best for me.

I have put echo tags in each file so I can track which files run when I start bash or tcsh (thanks to that long thread you guys posted long ago). This way I can see when each config file runs. This also helps me to figure out which config file to look at when there's an error.

rusto, thank you! I definitely miss my old prompt.

Regarding the question of fink/not fink... whether you guys meant to or not, you have both helped me to better understand what fink can do. I had read the info on the fink website, but that didn't quite explain it all as well as you two have. :)

vickishome 08-24-2002 11:35 AM

BTW, I must be missing something in my bash environment. Chown doesn't work! In fact, there are a number of things not working right.

For some reason, my /sw/bin/init.csh file said it was an Adobe image file. :confused: I know it's possible to change the file types using Unix, but I don't know those commands yet so I took the long route to fix the problem. I used BBEdit to copy the entire file, and put it in another file I named /sw/bin/init.csh2. Then I proceded to change the group and owner to match the original init.csh file. I had already switched to using bash as my startup shell. Chgrp worked just great. But when I attempted to use Chown, it said "command not found."
Code:

$ chown root newfile
bash: chown: command not found

Also, look at what happens when I attempt to use man:
Code:

$ man chmod
man: Formatting manual page...
There is no -F option ("less --help" for help)

$ man chown
man: Formatting manual page...
There is no -F option ("less --help" for help)

$ man chgrp
man: Formatting manual page...
There is no -F option ("less --help" for help)

Here's my tagging echos showing what's running when I start a new bash shell. As I mentioned before, I'm running Merv's config files which have not been edited to fit my environment so I get a couple of errors at startup:
Code:

Environment Setup Tagging:  Running ~/.bash_profile
Environment Setup Tagging:  Running /sw/bin/init.sh
Environment Setup Tagging:  Running ~/.bashrc
Environment Setup Tagging:  Running ~/.bash_aliases
Environment Setup Tagging:  Running ~/.bash_cdvars
bash: shopt: login_shell: unknown shell option name
Sat 24 Aug 2002 @ 10:25:24 CDT

10:25AM  up 19:48, 4 users, load averages: 0.14, 0.01, 0.01

vicki    console  Aug 23 14:38
vicki    ttyp1    Aug 24 08:51
vicki    ttyp2    Aug 23 22:20
vicki    ttyp3    Aug 23 19:16

  UID  PID  PPID CPU PRI NI      VSZ    RSS WCHAN  STAT  TT      TIME COMMAND
  501  1324  1323  0  31  0    5876    960 -      Ss+  p1    0:00.16 -tcsh (
  501  1381  1323  0  31  0    5028    956 -      Ss+  std    0:00.02 -bash (
  501  1368  1323  0  31  0    5876    956 -      Ss+  p2    0:00.12 -tcsh (
    0  1405  1381  0  31  0    1344    304 -      R+  std    0:00.00 ps alm

  PID STAT    RSS      TIME COMMAND
  311 S    57400  38:21.80 /Applications/Internet Explorer.app/Contents/MacOS/
  63 Ss    41592  42:25.16 /System/Library/CoreServices/WindowServer
  314 S    34736  69:11.30 /System/Library/CoreServices/Classic Startup.app/Co
  303 S    30784  0:28.72 /System/Library/CoreServices/Finder.app/Contents/Ma

Pageouts:                          0.

bash: netstat: command not found

du: illegal option -- h
usage: du [-H | -L | -P] [-a | -s] [-ckx] [file ...]
home size:

Capacity      Mounted

.-_-.-_-.-_-.
bash: fortune: command not found
.-_-.-_-.-_-.

Any idea where I should start looking to fix things?

Oh, I did eventually get my /sw/bin/init.csh file straightened out. I switched back to tcsh as my startup shell, and made the appropriate changes that way. I just need to figure out what's wrong with my bash environment. I suspect I have a wrong path in a config file somewhere??

vickishome 08-24-2002 01:21 PM

Got my man pages back in bash now. And chown is working again. :)

Merv's config files are so complex, I couldn't make heads or tails out of them. So I saved them elsewhere and plugged in osxpez's configs listed above. Now my man pages are back and chown is working.

I also created the symbolic link you suggested, osxpez. Plus, I installed the utils you suggested (ls is in color! yeah!). I think I'll run with your simpler config files until I know what I'm doing a little better.

I hadn't originally planned on switching to bash right now, but the book I'm reading uses bash in its examples, and so if I want to continue following the examples, I felt it was time to get bash installed. I believe I'm now at a point in which I can continue to read the book and run the examples myself so I have accomplished the goal I wanted. :) I have bash set up as my startup shell now. If I run into problems with bash, it's extremely easy to change my terminal preferences to fallback to tcsh so I haven't lost anything.

osxpez, I am curious about the backspace key problem you're having. How can I find out if I'm also having that problem (thus, require the code in the configs to remedy it)? Since I'm now running your configs, I don't know how to test to see if I require that code in my configs or not. Can you elaborate on the backspace key problem or point me to a thread where you may have discussed it before?

SpongeBob 08-24-2002 01:44 PM

I might have missed someone's reply on this but bash is installed in the 10.2 installation. It's in /bin/bash. No fink required. That's for the people who aren't quite up for a fink install or like me are waiting for the couple of fink packages that I use to be updated before reinstalling fink.

vickishome 08-24-2002 01:54 PM

Quote:

Originally posted by SpongeBob
I might have missed someone's reply on this but bash is installed in the 10.2 installation.
Right. Those who are upgrading to Jag can totally skip this entire thread since bash is already installed on Jag.

However, I'm going through these steps because I'm not installing Jag yet, but I want bash now.

Just think... only 4 months ago, I was running my G3 with OS 8.1! Going to OS X/Unix/tcsh/bash/fink his has been a huge jump for me (and that doesn't include the fact that I have a new G4, new printer, new scanner and tons of new, upgraded software). I'm going to stick with OS X 10.1.5 until I finally catch my breath on all of these changes.

osxpez 08-25-2002 10:40 AM

Quote:

Originally posted by vickishome
I think I'll run with your simpler config files until I know what I'm doing a little better.
What could ever be wrong with simplicity? :) In fact my config setup gets simpler and simpler all the time. That's what happens when I know better what I'm doing. Then I know what can be removed.

Quote:

Originally posted by vickishome
osxpez, I am curious about the backspace key problem you're having. How can I find out if I'm also having that problem (thus, require the code in the configs to remedy it)? Since I'm now running your configs, I don't know how to test to see if I require that code in my configs or not. Can you elaborate on the backspace key problem or point me to a thread where you may have discussed it before?
The problem shows for me when editing in VIM. When I hit the backspace key, the character to the left of the cursor should be erased, right? But instead it erases the character under the cursor (like the DEL key in Windows if that's familiar). The "stty" command can be used to examine and change settings having to do with the terminal and it's behaviour. "stty -a" shows all settings. It showed "erase = ^H" in my case and that made the backspace key send my terminal an erase command which deleted the wrong character. Explaining my /etc/bashrc to you made me realize that it was that one that caused the error. It contained a line reading something like "stty erase = `tput kbs`" which I read as "set erase to be Key BackSpace". So now I have deleted that part as well as the loop over /etc/profile.d/*.sh files which I didn't use anyway. So now my /etc/bashrc looks like:
Code:

$ cat /etc/bashrc
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
        xterm*)
            PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
            ;;
        *)
            ;;
    esac
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
fi

# Falesafe
alias rm='rm -i'
[peter@localhost

And I could remove the "stty" command in my local .bashrc and now backspace behaves anyway. See? The more I understand, the more I can simplify (or just remove). :)

Hope I didn't confuse you as much as I confused myself with this post.

osxpez 08-25-2002 10:50 AM

Quote:

Originally posted by sao
To be exact and precise, the following hardly seems a statement for 'most' users, but in the contrary, for all users who read it.

But avoid the "fink" command and stick with apt-get and dselect. (...)
Quite the contrary. That was advice for Vicki, who I had seen post things telling she was new to Unix and wanting to learn stuff a step at a time.

Quote:

Originally posted by sao
You can easily leave your terminal or several running in the back installing
I probably could. But I also would have to have the time testing whatever it was I had installed and also time to cope with whatever trouble it brought with it and then time to report those errors back to whom it concerns. I'll do that when I find myself needing a package that's not in "stable".

osxpez 08-25-2002 11:01 AM

One more thing, slightly off topic. I never use Apple's bundled Terminal application. It's lame and slow. From Aqua I use GLTerm which fast and the dude who made it is very friendly and responsive. Often I also use Eterm from OroborOSX. I have the full XDarwin installed as well, but I find OroborOSX most often being the best fit for me. As long as I have done my "sudo apt-get install eterm" I can just select Eterm from OroborOSX Start menu.

Anyone using Jag who can tell me if Terminal.app has gotten any faster there?

sao 08-25-2002 12:43 PM

osxpez,

Quote:

That was advice for Vicki, who I had seen post things telling she was new to Unix and wanting to learn stuff a step at a time.
Unfortunately, the posts are read by 'everyone'. Good thing that you clarify 'now' that your advice was only for Vickishome.


Quote:

I probably could
Only when you want, and it is clear to me that you don't. Which is very fine with me. But then, don't stop others from trying.


You use pre-compiled packages and you are very happy with it. And it works very well for you. Great!

I use only cutting edge unstable, and all my installation from source. And it works very well for me. Great!


So both can coexist as it is not only 'your way'...


Cheers...


All times are GMT -5. The time now is 10:35 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.