public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Newbie Alias and Profile questions
@ 2014-02-11  1:26 Mike Rushton
  2014-02-11  1:38 ` Larry Hall (Cygwin)
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Mike Rushton @ 2014-02-11  1:26 UTC (permalink / raw)
  To: cygwin

Can some one give me some hints about this ?

I read the documentation and can't figure this out.

I am trying to put an alias in a .bashrc

alias clear='printf "\033c"'

But what .bashrc do I put this in ?  in /ect/skel or the one my user 
directory.   I put this code in and it seems to get overwritten.
I don't understand what I am doing wrong.

It is a minor thing that i can't clear the screen, but i want to work at 
this and try to fix this.


Then I want to add a script to my profile.   but what one the .profile 
or .bash_profile ?

Other that these problems, I am converting my Korn shell scripts to bash 
under Cygwin and it is going pretty good so far.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-11  1:26 Newbie Alias and Profile questions Mike Rushton
@ 2014-02-11  1:38 ` Larry Hall (Cygwin)
  2014-02-11  2:35   ` Mike Rushton
  2014-02-11  2:14 ` Christopher Faylor
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Larry Hall (Cygwin) @ 2014-02-11  1:38 UTC (permalink / raw)
  To: cygwin

On 2/10/2014 8:15 PM, Mike Rushton wrote:
> Can some one give me some hints about this ?
>
> I read the documentation and can't figure this out.
>
> I am trying to put an alias in a .bashrc
>
> alias clear='printf "\033c"'
>
> But what .bashrc do I put this in ?  in /ect/skel or the one my user
> directory.   I put this code in and it seems to get overwritten.
> I don't understand what I am doing wrong.

Overwritten?  By what?  What's your home directory?

> It is a minor thing that i can't clear the screen, but i want to work at
> this and try to fix this.

OK but 'clear' will do what you want.

> Then I want to add a script to my profile.   but what one the .profile or
> .bash_profile ?

Unless you want it available to all users and other shells, put it in your
.bash_profile.

> Other that these problems, I am converting my Korn shell scripts to bash
> under Cygwin and it is going pretty good so far.

FYI, at least the last 2 questions above are general UNIX/Linux questions.
You should consult a good UNIX/Linux resource for some basic user tutorials
and guides.



-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-11  1:26 Newbie Alias and Profile questions Mike Rushton
  2014-02-11  1:38 ` Larry Hall (Cygwin)
@ 2014-02-11  2:14 ` Christopher Faylor
  2014-02-16 10:09 ` Thorsten Kampe
  2014-04-14  5:22 ` Ken Jackson
  3 siblings, 0 replies; 8+ messages in thread
From: Christopher Faylor @ 2014-02-11  2:14 UTC (permalink / raw)
  To: cygwin

Can we have a moratorium on the term "newbie" please?  Please
just ask your questions.

On Mon, Feb 10, 2014 at 08:15:28PM -0500, Mike Rushton wrote:
>Can some one give me some hints about this ?
>
>I read the documentation and can't figure this out.
>
>I am trying to put an alias in a .bashrc
>
>alias clear='printf "\033c"'
>
>But what .bashrc do I put this in ?  in /ect/skel or the one my user 
>directory.   I put this code in and it seems to get overwritten.
>I don't understand what I am doing wrong.

http://lmgtfy.com/?q=what+is+%2Fetc%2Fskel%3F

>It is a minor thing that i can't clear the screen, but i want to work at 
>this and try to fix this.
>
>
>Then I want to add a script to my profile.   but what one the .profile 
>or .bash_profile ?

http://lmgtfy.com/?q=what+is+.bashrc

>Other that these problems, I am converting my Korn shell scripts to bash 
>under Cygwin and it is going pretty good so far.

These are all basic bash questions.  While I'm sure some kind soul will
help you further and we'll likely have a long thread discussing startup
files, you really should be investigating existing resources on the web
for bash.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-11  1:38 ` Larry Hall (Cygwin)
@ 2014-02-11  2:35   ` Mike Rushton
  2014-02-12  9:08     ` Mike Rushton
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Rushton @ 2014-02-11  2:35 UTC (permalink / raw)
  To: cygwin

Well let me work at it tomorrow.

I know how to do this on other unix systems, just that Cygwin is not 
acting as I am used too.

I have done things like this on some versions of RHEL, UnixWare,  Xenix, 
MKS Tookit.

I guess I have to keep reading the Documentation and trying things.

( and no more use of the term Newbie :-)  )


On 2/10/2014 8:26 PM, Larry Hall (Cygwin) wrote:
> On 2/10/2014 8:15 PM, Mike Rushton wrote:
>> Can some one give me some hints about this ?
>>
>> I read the documentation and can't figure this out.
>>
>> I am trying to put an alias in a .bashrc
>>
>> alias clear='printf "\033c"'
>>
>> But what .bashrc do I put this in ?  in /ect/skel or the one my user
>> directory.   I put this code in and it seems to get overwritten.
>> I don't understand what I am doing wrong.
>
> Overwritten?  By what?  What's your home directory?
>
>> It is a minor thing that i can't clear the screen, but i want to work at
>> this and try to fix this.
>
> OK but 'clear' will do what you want.
>
>> Then I want to add a script to my profile.   but what one the 
>> .profile or
>> .bash_profile ?
>
> Unless you want it available to all users and other shells, put it in 
> your
> .bash_profile.
>
>> Other that these problems, I am converting my Korn shell scripts to bash
>> under Cygwin and it is going pretty good so far.
>
> FYI, at least the last 2 questions above are general UNIX/Linux 
> questions.
> You should consult a good UNIX/Linux resource for some basic user 
> tutorials
> and guides.
>
>
>


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-11  2:35   ` Mike Rushton
@ 2014-02-12  9:08     ` Mike Rushton
  2014-02-12 12:47       ` Andrey Repin
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Rushton @ 2014-02-12  9:08 UTC (permalink / raw)
  To: cygwin

OK, I got it working ...  I have my home in an directory other that what 
Cygwin defaults because other software run needs

I thought my files were being overwritten ... but no - I was modifying 
the wrong files.

After I found the correct files and modified the .bash_profile 
everything was fine.

I was not aware of this .bash_profile and I was not aware of the source 
command.   On the versions of Unix/Linux that I have used
I would always do a .profile to execute the commands in it when I made 
changes.

So again I was making changes and the shell was not aware of the changes.

Hey,  I've been using Cygwin for like 2 weeks ,,,






On 2/10/2014 9:13 PM, Mike Rushton wrote:
> Well let me work at it tomorrow.
>
> I know how to do this on other unix systems, just that Cygwin is not 
> acting as I am used too.
>
> I have done things like this on some versions of RHEL, UnixWare, 
> Xenix, MKS Tookit.
>
> I guess I have to keep reading the Documentation and trying things.
>
> ( and no more use of the term Newbie :-)  )
>
>
> On 2/10/2014 8:26 PM, Larry Hall (Cygwin) wrote:
>> On 2/10/2014 8:15 PM, Mike Rushton wrote:
>>> Can some one give me some hints about this ?
>>>
>>> I read the documentation and can't figure this out.
>>>
>>> I am trying to put an alias in a .bashrc
>>>
>>> alias clear='printf "\033c"'
>>>
>>> But what .bashrc do I put this in ?  in /ect/skel or the one my user
>>> directory.   I put this code in and it seems to get overwritten.
>>> I don't understand what I am doing wrong.
>>
>> Overwritten?  By what?  What's your home directory?
>>
>>> It is a minor thing that i can't clear the screen, but i want to 
>>> work at
>>> this and try to fix this.
>>
>> OK but 'clear' will do what you want.
>>
>>> Then I want to add a script to my profile.   but what one the 
>>> .profile or
>>> .bash_profile ?
>>
>> Unless you want it available to all users and other shells, put it in 
>> your
>> .bash_profile.
>>
>>> Other that these problems, I am converting my Korn shell scripts to 
>>> bash
>>> under Cygwin and it is going pretty good so far.
>>
>> FYI, at least the last 2 questions above are general UNIX/Linux 
>> questions.
>> You should consult a good UNIX/Linux resource for some basic user 
>> tutorials
>> and guides.
>>
>>
>>
>


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-12  9:08     ` Mike Rushton
@ 2014-02-12 12:47       ` Andrey Repin
  0 siblings, 0 replies; 8+ messages in thread
From: Andrey Repin @ 2014-02-12 12:47 UTC (permalink / raw)
  To: Mike Rushton, cygwin

Greetings, Mike Rushton!

Please don't http://cygwin.com/acronyms/#TOFU

> OK, I got it working ...  I have my home in an directory other that what 
> Cygwin defaults because other software run needs

> I thought my files were being overwritten ... but no - I was modifying 
> the wrong files.

> After I found the correct files and modified the .bash_profile 
> everything was fine.

> I was not aware of this .bash_profile and I was not aware of the source 
> command.   On the versions of Unix/Linux that I have used
> I would always do a .profile to execute the commands in it when I made 
> changes.

You've been pointed to the bash man page.
It is all explained there, English on black.

> So again I was making changes and the shell was not aware of the changes.

> Hey,  I've been using Cygwin for like 2 weeks ,,,

As has been said already, this is NOT a Cygwin question.


--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 12.02.2014, <15:52>

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-11  1:26 Newbie Alias and Profile questions Mike Rushton
  2014-02-11  1:38 ` Larry Hall (Cygwin)
  2014-02-11  2:14 ` Christopher Faylor
@ 2014-02-16 10:09 ` Thorsten Kampe
  2014-04-14  5:22 ` Ken Jackson
  3 siblings, 0 replies; 8+ messages in thread
From: Thorsten Kampe @ 2014-02-16 10:09 UTC (permalink / raw)
  To: cygwin

* Mike Rushton (Mon, 10 Feb 2014 20:15:28 -0500)
> I am trying to put an alias in a .bashrc
> 
> alias clear='printf "\033c"'

clear is part of the ncurses package, so I would simply install this.

> But what .bashrc do I put this in ?  in /ect/skel or the one my user 
> directory.   I put this code in and it seems to get overwritten.
> I don't understand what I am doing wrong.

/etc/skel is a template directory for new users.
 
> It is a minor thing that i can't clear the screen, but i want to work at 
> this and try to fix this.
> 
> Then I want to add a script to my profile.   but what one the
> .profile or .bash_profile ?

The two bash specific files you need to know are .bash_profile and 
.bashrc. Bash is different to other shells in that it will only read 
one of those two depending on whether bash is run as a login shell or 
not.

The recommended way is to source .bashrc from .bash_profile (this is 
already the Cygwin default) and to leave .bash_profile empty. Put 
everything you need into .bashrc.

Forget about .profile. It's only needed for backward compatibility 
and not an official bash file.

Thorsten


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Newbie Alias and Profile questions
  2014-02-11  1:26 Newbie Alias and Profile questions Mike Rushton
                   ` (2 preceding siblings ...)
  2014-02-16 10:09 ` Thorsten Kampe
@ 2014-04-14  5:22 ` Ken Jackson
  3 siblings, 0 replies; 8+ messages in thread
From: Ken Jackson @ 2014-04-14  5:22 UTC (permalink / raw)
  To: cygwin

On 02/10/2014 08:15 PM, Mike Rushton wrote:
> I am trying to put an alias in a .bashrc
>
> alias clear='printf "\033c"'

Sometimes 'clear' is installed and sometimes it's not, so
I put this line in my ~/.bashrc file on all Linux, BSD and
Cygwin systems:

test -z "$(type -t clear)"  &&  alias clear='echo -n -e "\e[2J\e[H"'

-Ken

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-04-14  5:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-11  1:26 Newbie Alias and Profile questions Mike Rushton
2014-02-11  1:38 ` Larry Hall (Cygwin)
2014-02-11  2:35   ` Mike Rushton
2014-02-12  9:08     ` Mike Rushton
2014-02-12 12:47       ` Andrey Repin
2014-02-11  2:14 ` Christopher Faylor
2014-02-16 10:09 ` Thorsten Kampe
2014-04-14  5:22 ` Ken Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).