Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 153017 - /etc/profile.d/vim.csh: return not understand by tcsh
Summary: /etc/profile.d/vim.csh: return not understand by tcsh
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Karsten Hopp
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2005-03-31 22:19 UTC by Edgar Hoch
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-04-04 12:50:47 UTC

Attachments (Terms of Use)

Description Edgar Hoch 2005-03-31 22:19:15 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; de-AT; rv:1.7.5) Gecko/20041221

Description of problem:
/etc/profile.d/vim.csh contains the line

[ -w /etc/passwd ] && return

But when I start 'tcsh' then I get the error message:

return: Command not found.

That line should be changed to

if ( -w /etc/passwd ) then

Then tcsh starts without an error message.
This patch is so small that I have shown in this message.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.Enter 'tcsh' at the shell prompt.

Actual Results:  Error message:
return: Command not found.

Expected Results:  No error message.

Additional info:

Comment 1 Göran Uddeborg 2005-04-04 12:20:51 UTC
Since the only other thing done in the vim.csh file is setting an alias, an even
simpler fix would be to have only this single line in the file:

  if ( ! -w /etc/passwd ) alias vi vim

Comment 2 Karsten Hopp 2005-04-04 12:50:47 UTC
This breaks with selinux because -w tries to open /etc/passwd rw, see bug 150126

The current version look like this:
[ -x /usr/bin/id ] || exit
[ `/usr/bin/id -u` -le 100 ] && exit
alias vi vim

This sets the alias for all userids > 100 and doesn't do anything if id is
missing (/usr not mounted).

Note You need to log in before you can comment on or make changes to this bug.