Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Moving from .cshrc to .bashrc Post 302547208 by MaindotC on Sunday 14th of August 2011 05:53:08 PM
Old 08-14-2011
Moving from .cshrc to .bashrc

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:
Code:
echo $host
if ( $host == 'a.a.a.a.') then
setenv env 'development';

if ( $host == 'b.b.b.b') then
setenv env 'production';

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:
Code:
-bash: export: `1': not a valid identifier
-bash: export: `.:<company_defined_paths_omitted>:/usr/local/bin:/usr/bin:/usr/sbin:/bin:': not a valid identifier
-bash: export: `a.a.a.a': not a valid identifier
-bash: export: `': not a valid identifier

-bash: .bashrc: line 55: syntax error: unexpected end of file

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?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cshrc

where are my .cshrc files ? (4 Replies)
Discussion started by: cubicle^dweller
4 Replies

2. UNIX for Dummies Questions & Answers

how to specify header directory in .cshrc

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)
Discussion started by: champion
1 Replies

3. UNIX for Advanced & Expert Users

.cshrc and .login overwritten !!

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)
Discussion started by: gjthomas
5 Replies

4. UNIX for Dummies Questions & Answers

.cshrc flie help

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)
Discussion started by: Lefty
2 Replies

5. UNIX for Dummies Questions & Answers

doubt in .cshrc

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)
Discussion started by: priyam
0 Replies

6. UNIX for Dummies Questions & Answers

flags inside .cshrc

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)
Discussion started by: oldtrash
1 Replies

7. Virtualization and Cloud Computing

.cshrc file

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)
Discussion started by: zainster
3 Replies

8. Shell Programming and Scripting

Problem with my .cshrc

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)
Discussion started by: perl0101
1 Replies

9. Solaris

Explain @(#)cshrc 1.11 89/11/29 SMI

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)
Discussion started by: fgrirx
2 Replies

10. Solaris

CSHRC and PATH problem please help

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)
Discussion started by: jstevanus
2 Replies
VDETAPLIB(1)						      General Commands Manual						      VDETAPLIB(1)

NAME
vdetaplib - Virtual Distributed Ethernet tap emulation library SYNOPSIS
No synopsis DESCRIPTION
vdetaplib is a library that emulates tap (tuntap level2 interface, see in kernel sources Documentation/networking/tun.c) and connects tap virtual interfaces to vde networks. To use it, the libvdetab.so library must be preloaded (sh, ksh or bash syntax): export LD_PRELOAD=/usr/lib/vde2/libvdetap.so (csh, tchs syntax): setenv LD_PRELOAD /usr/lib/vde2/libvdetap.so If you want to divert all tap requests to a single vde_switch set the variable VDEALLTAP to the vde socket. (sh, ksh or bash syntax): export VDEALLTAP=/tmp/vde.ctl (csh, tchs syntax): setenv VDEALLTAP /tmp/vde.ctl It is possible to set each single interface to different vde_switches by setting the environment variable with the same name of the inter- face. (sh, ksh or bash syntax): export tap0=/tmp/vde.ctl export tap1=/tmp/myvde.ctl export ppc=/tmp/ppc.ctl (csh, tchs syntax): setenv tap0 /tmp/vde.ctl setenv tap1 /tmp/myvde.ctl setenv ppc /tmp/ppc.ctl It is also possible to specify port, group or mode for a given interface setting environment variables as in the following example. (sh, ksh or bash syntax): export tap0_port=5 export tap0_group=vde-net export tap0_mode=0660 (csh, tchs, syntax): setenv tap0_port 5 setenv tap0_group vde-net setenv tap0_mode 0660 The variable to set the specific interface is checked first then VDEALLTAP. VDEALLTAP thus works as a default choice for the vde switch to be used. If VDEALLTAP is not set and there is no specific environment variable (and for tun -- IFF_TUN interfaces) the kernel provided interface is used. In this latter case access to /dev/net/tun is required, generally root access. NOTICE
Virtual Distributed Ethernet is not related in any way with www.vde.com ("Verband der Elektrotechnik, Elektronik und Informationstechnik" i.e. the German "Association for Electrical, Electronic & Information Technologies"). SEE ALSO
vde_switch(1), vdeq(1). AUTHOR
VDE is a project by Renzo Davoli <renzo@cs.unibo.it> Virtual Distributed Ethernet December 6, 2006 VDETAPLIB(1)
All times are GMT -4. The time now is 11:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy