CYGWIN Unix .bash_profile


#1

hi all

i am using Cygwin on windows and i am curious about what does a dot before .bash_profile means

thanks


#2

The dot means current directory. So .bash_profile refers to the file 'bash_profile' in the current directory.


#3

what does the bash profile means then


#4

It has the profile settings for the bash shell. Read about it here: http://www.linuxfromscratch.org/blfs/view/6.3/postlfs/profile.html


#5

[quote=", post:, topic:"]

The dot means current directory. So .bash_profile refers to the file ‘bash_profile’ in the current directory.
[/quote]

Wrong. The dot “.”, in front of this (or any) file name in *nix world means a hidden file. As Cygwin is a Unix emulation layer for Windows, it is natural that all hidden files start with a period or dot. As “.bash_profile” is the login script for users using the bash shell, it makes sense to keep it hidden. You can still ls this and all other hidden files by using the command ls -a on the terminal.

HTH


#6

^ Ahh...you're right! Sorry about that. Completely forgot about hidden files in unix!

.bash_profile is the bash configuration file for the user (its stored in ~ i.e. the home directory for each user).


#7

i have another question

what does gcc –Wall –o does.

all i know that gcc is a c compiler and it creates a binary in the current working directory

what does this -Wall and this -o does


#8

[quote=", post:, topic:"]

what does this -Wall and this -o does

[/quote]

In gcc, -W option is used to output compile time warnings. There are many types of warnings like return-type warning, which warns about functions not declared void or returning a value, or there is unused warning which informs about unused variables. Instead of specifying individual warnings like gcc -Wunused -Wreturn-type, you can specify -Wall option which is the mother of all and displays all warnings.

The -o option is used to specify the output file name. If not specified, the linker will create a file named a.out (unless -c flag is specified).


#9

[quote=", post:, topic:"]

^ Ahh…you’re right! Sorry about that. Completely forgot about hidden files in unix!

.bash_profile is the bash configuration file for the user (its stored in ~ i.e. the home directory for each user).

[/quote]

@sah: do you know any “Jimmy”?


#10

What is > operator and what is the difference between

> & >> operator in a .c file in cygwin


#11

@saaron: Naa. I haven't messed with bash_profile that much.

@kashifmehmood: You seem to be a bit confused. Cygwin just interacts with the Windows filesystem the same way you would do in a Unix based system. It doesn't have anything to do with .c files, which are just source files for the C programming language.

In C:

> is greater than. (e.g. if (5>2) { //then true; } )

>> is the bitwise right shift operator (e.g. if you bitwise right shift 2, it becomes 1

i.e. in binary, 0010 shifted right once become 0001)


#12

> or >> in the Shell or command prompt context is Stream redirection operator. It will redirect output to the Target file.

in a .C file ( C source code ) > is Greator than Operator and >> Bitwise shift operator it will shift bits.


#13

[quote=", post:, topic:"]

What is > operator and what is the difference between

> & >> operator in a .c file in cygwin

[/quote]

What sah said.

@sah: I meant do you know any guy named jimmy? I knew a jimmy whose initials were also SAH and he lives somewhere in Canada too.


#14

^ Haha. I thought you meant if I knew of any bash_profile hacks! :P And no I don't know any guy named Jimmy. Canada's a fairly large country! ;)


#15

guys i am asking a question


#16

^ Your questions have been answered....open your eyes...


#17

oh sorry


#18

> will redirect output to a file overwriting any existing content

>> will also redirect output but it will append data to the existing content in the target file.


#19

[quote=", post:, topic:"]

> will redirect output to a file overwriting any existing content

>> will also redirect output but it will append data to the existing content in the target file.

[/quote]

He was asking with regards to a .c file.


#20

no no i mean i run .c files in CYGWIN where a file is used to create some .c files using the ./script

it contained operators like > and >>

as abdulsami said

"> or >> in the Shell or command prompt context is Stream redirection operator. It will redirect output to the Target file".