At work I've been moved from ksh to bash per our policy. I haven't configured a .profile or .cshrc before but when I first started the guy that trained me (on just what I need to know in order to do the job) let me copy his .profile, .cshrc, and .cshrc_aliases file so we could all use them and then upload them to each server on which we administer accounts. We've always used ksh as a default so I'm not sure why he had us put a .cshrc file as I believe this pertains to c shell but when i would edit this file it would definitely reflect the change so I just rolled with it.
Now I have to use bash and I just want to get a few tweaks implemented from .cshrc but the syntax appears wrong. For example, in my .cshrc I have one of many if/then statements:
where a.a.a.a and b.b.b.b represent hostnames in our company. I want to login to a devlopment, production, or other environment server and have my prompt reflect that I am in the respective environment. I noticed that in .cshrc the setenv seems to be the equivalent of export in .bashrc but I tried replacing all %s/setenv/export/g and I still received an error when sourcing my .bashrc:
Again - a.a.a.a is a hostname in our company. Is there more to defining those aliases or am I using the export directive incorrectly?
I can't do it verbatim but I've edited the parts specific to my company:
Granted - this was all copied from my .cshrc file and the term "export" was replaced by "setenv". I haven't tried the aforementioned edit yet - not so sure the part: host) looks right with an open parenthesis but I'll try it later.
It's not just the export vs setenv that's different. The entire language is different. bash is not csh. You'll have to rewrite it as bash code. The example I posted for you would be a good start.
Last edited by Corona688; 08-15-2011 at 05:30 PM..
It's not just the export vs setenv that's different. The entire language is different. bash is not csh. You'll have to rewrite it as bash code. The example I posted for you would be a good start.
Corona thanks for your suggestion. As I stated earlier I pasted the contents of the find/replace without entering your edits yet as I have to continue my work as usual before I can test new configurations and I've been extremely busy.
Now, that being said I tried implementing what you suggested and I'm having a problem. I'm just trying to get SOMETHING working for starters so I'm trying this snippet in my .bashrc:
where "a" and "b" are hostnames of servers in my company. Then I run source .bashrc and I keep getting an error message stating:
where a.a.a.a is the fqdn of the host I'm using. Why is this happening?
export makes the NAME of your variable available to child processes. A variable has a NAME and a VALUE assigned with the EQUAL SIGN (=) in the form: name=value. An example in the bashrc that you posted should be->
I'm doing some IVR programming and it uses Solaris 10. I know little about Unix, or CSH, but I think it's a problem with my .cshrc file. I was getting an error: "nstancehomedir/sqllib/bin/db2fupdt: Command not found" and also "set: Syntax error" when I log in. I found db2fupdt in 2 directories,... (2 Replies)
What does ' @(#)cshrc 1.11 89/11/29 SMI ' mean?
Can someone please deconstruct and explain the parts?
# @(#)cshrc 1.11 89/11/29 SMIIt is at the top of a the .cshrc of a new Solaris account I am working on.
I am familiar with using the first line of a script for setting the program/shell to... (2 Replies)
Hello everyone,
I write a ~/.cshrc for set class path to run my java application. The file is listed below.
setenv YFILTER_HOME ~/yfilter-2.0
setenv PATH "$YFILTER_HOME/bin:$PATH"
setenv CLASSPATH... (1 Reply)
Hi All,
I was hoping someone could help me with the following query I have please in relation to NX Nomachine.
Is there a way to get my .cshrc file in say my “US” home dir” to run when I login to another server e.g say a UK server?
Any advise would be much appreciated, thanks (3 Replies)
Hi,
I use a specific utility in my .cshrc for setting up the right fonts and I believe it's sufficient to run it once for a whole session.
Since I have sourced it in my .cshrc, it runs every time I do a source of .cshrc or invoke every new terminal.
To resolve this issue, I thought of... (1 Reply)
what kind of information is there .cshrc ?
I want to set an alias in the form of
=>#alias setprompt 'set prompt=">>$user<<@`hostname`:${cwd}% "'
Ex. alias pr 'cd /home/username'
when I make the change and try to do $pr ... its saying pr: command not found
Is there any way I can... (0 Replies)
How can I set up my .cshrc file to do as the posix shell does the escape+k to scroll my command history
Thanks
Oh BTW, Hi I'm new to the forum. (2 Replies)
Hi, My account is : abcd
I belong to a group: pqrs
Some thing straneg happened yesterday.
My .cshrc and .login got overwritten into pqrs's .cshrc and .login
I obviously did not explicitly overwrite pqrs's .cshrc.
Are there any reasons how this could have happened indirectly due to... (5 Replies)
in my .cshrc file, i can set my library files directory like this :
setenv LD_LIBRARY_PATH "/usr/openwin/lib"
now i want to specify my header files directory. please teach how to set it and what/how is the syntax
thank u (1 Reply)