Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

.profile in users Directory

34 views
Skip to first unread message

Peter James

unread,
Jun 2, 2015, 9:21:11 AM6/2/15
to
I am attempting to run Unix under Mac OSX 10.10.3.

My text book tells me I can write a .profile in my users
directory that can affect and change the way I use Unix.

I have written a file .profile that is in Users/peter and
includes the following lines.

alias ls="/bin/ls -aF"
alias desktop="cd ~/Desktop
alias rm="rm -i"
alias cp="cp -i"
alias mv="mv -i"

export PS1="\h \u \w \$ "

And yet nothing works as per the above lines.
Have I got the syntax wrong, or have I just read the
manual incorrectly? Or is the file .profile in the
wrong directory?

Thanks,

Peter

Barry Margolin

unread,
Jun 2, 2015, 10:18:00 AM6/2/15
to
In article <slrnmmrbe...@phreddesimacg54.lan>,
What shell are you running? That should work as long as you're not using
csh or tcsh as your shell.

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Kenny McCormack

unread,
Jun 2, 2015, 10:20:57 AM6/2/15
to
In article <barmar-769E8C....@88-209-239-213.giganet.hu>,
Barry Margolin <bar...@alum.mit.edu> wrote:
...
>What shell are you running? That should work as long as you're not using
>csh or tcsh as your shell.

He mentioned the Mac (OSX), so I assume bash.

This sounds to me like he's getting lost in the maze of twisty passages
that is the bash startup file mess. That is, which file(s) get sourced on
startup depends on a rather complex set of rules, that, frankly, puzzles me.

--
Religion is regarded by the common people as true,
by the wise as foolish,
and by the rulers as useful.

(Seneca the Younger, 65 AD)

Barry Margolin

unread,
Jun 2, 2015, 10:24:35 AM6/2/15
to
In article <mkke48$nlf$1...@news.xmission.com>,
gaz...@shell.xmission.com (Kenny McCormack) wrote:

> In article <barmar-769E8C....@88-209-239-213.giganet.hu>,
> Barry Margolin <bar...@alum.mit.edu> wrote:
> ...
> >What shell are you running? That should work as long as you're not using
> >csh or tcsh as your shell.
>
> He mentioned the Mac (OSX), so I assume bash.

For the first few releases of OS X, the default shell was tcsh. So if
he's been running OS X for a long time, and just upgrading, he would
still be using tcsh.

>
> This sounds to me like he's getting lost in the maze of twisty passages
> that is the bash startup file mess. That is, which file(s) get sourced on
> startup depends on a rather complex set of rules, that, frankly, puzzles me.

True, if you have .bash_profile it takes precedence over .profile.

Kenny McCormack

unread,
Jun 2, 2015, 10:40:12 AM6/2/15
to
In article <barmar-0BDEBB....@88-209-239-213.giganet.hu>,
Barry Margolin <bar...@alum.mit.edu> wrote:
>In article <mkke48$nlf$1...@news.xmission.com>,
> gaz...@shell.xmission.com (Kenny McCormack) wrote:
>
>> In article <barmar-769E8C....@88-209-239-213.giganet.hu>,
>> Barry Margolin <bar...@alum.mit.edu> wrote:
>> ...
>> >What shell are you running? That should work as long as you're not using
>> >csh or tcsh as your shell.
>>
>> He mentioned the Mac (OSX), so I assume bash.
>
>For the first few releases of OS X, the default shell was tcsh. So if
>he's been running OS X for a long time, and just upgrading, he would
>still be using tcsh.

Wow. I didn't know that. I must have joined the OSX bandwagon fairly
late, because it's always been bash IME.

tcsh is so much better than bash (interactively).
I just never get around to changing it.

--
The book "1984" used to be a cautionary tale;
Now it is a "how-to" manual.

Peter James

unread,
Jun 2, 2015, 11:41:15 AM6/2/15
to
On 2015-06-02, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article <slrnmmrbe...@phreddesimacg54.lan>,
> Peter James <pe...@pfjames.co.uk> wrote:
>
>> I am attempting to run Unix under Mac OSX 10.10.3.
>>
>> My text book tells me I can write a .profile in my users
>> directory that can affect and change the way I use Unix.
>>
>> I have written a file .profile that is in Users/peter and
>> includes the following lines.
>>
>> alias ls="/bin/ls -aF"
>> alias desktop="cd ~/Desktop
>> alias rm="rm -i"
>> alias cp="cp -i"
>> alias mv="mv -i"
>>
>> export PS1="\h \u \w \$ "
>>
>> And yet nothing works as per the above lines.
>> Have I got the syntax wrong, or have I just read the
>> manual incorrectly? Or is the file .profile in the
>> wrong directory?
>>
>> Thanks,
>>
>> Peter
>
> What shell are you running? That should work as long as you're not using
> csh or tcsh as your shell.
>
I'm using bash and the manual I'm using for guideance is:

"Unix for Mac OS X by Dave Taylor"

Peter

Peter James

unread,
Jun 2, 2015, 11:46:30 AM6/2/15
to
The command:
$Echo SHELL returns
/bin/bash

Peter

Barry Margolin

unread,
Jun 2, 2015, 12:19:49 PM6/2/15
to
In article <slrnmmrjk...@PhreddesiMacG54.lan>,
Do you have a file .bash_profile? Like I said in another post, that
takes precedence over .profile if you have both.

BTW, you're missing a " at the end of the desktop alias. Was that a
copying error or is it missing in the file? That would screw up
everything after that.

Peter James

unread,
Jun 2, 2015, 2:13:48 PM6/2/15
to
Thank you, that's the answer. I put the aliases in the file
.bash_profile and it all worked.
> BTW, you're missing a " at the end of the desktop alias. Was that a
> copying error or is it missing in the file? That would screw up
> everything after that.
Just a typo. thanks for pointing it out.
Thank you again. I was beginning to despair about Unix. I shall now
perservere.

Peter
0 new messages