tcsh issues


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tcsh issues
# 1  
Old 05-11-2010
tcsh issues

HI,
I am having strange issues with my tcsh shell.

First, the "ln" command doesnt seem to work properly.
I have a file "target" that is pointing to "file1". I cannot access file1 but that shouldnt matter.
when I do this, ln -sf file2 target
I get permission denied that I cannot access the file1.
So I have to do this to make it work:
Code:
rm -f target; ln -sf file2 target

Second,if my command is defined in 3 lines it does not work. e.g
Code:
alias mya ' ln -sf p.sh p1; \
	      ln -sf p.sh p2; \
	     echo "Done"'
throws an error -f: Command not found..
However when i define my command in 1 or 2 lines it works. e.g. this works
alias mya ' ln -sf p.sh p1; ln -sf p.sh p2; \
	     echo "Done"'

What could be the reason for these strange errors? everything works in bash. Is tcsh this bad?

any help appreciated.

Karan

Last edited by sardare; 05-11-2010 at 10:48 AM.. Reason: code tags, please...
# 2  
Old 05-11-2010
Quote:
Originally Posted by sardare
HI,
I am having strange issues with my tcsh shell.

First, the "ln" command doesnt seem to work properly.
I have a file "target" that is pointing to "file1". I cannot access file1 but that shouldnt matter.
when I do this, ln -sf file2 target
I get permission denied that I cannot access the file1.
So I have to do this to make it work:
Code:
rm -f target; ln -sf file2 target

Try calling the ln command with the full path, i.e. /bin/ln or wherever it's installed on your system, to guarantee you're using the real ln and not a shell builtin.
Quote:
What could be the reason for these strange errors? everything works in bash. Is tcsh this bad?
Two things:

1) tcsh is not a Bourne shell. Its syntax is occasionally very, very different from BASH's.
2) csh and derivitaves are infamously bad. Avoid them if you can.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Tcsh to sh

Dear all, I have piece of command from tcsh, which I would like to be in my .bashrc file. However, I am comletely blank about the tcsh commandline. if (-e ~/forum/dir/code.sh) then source ~/forum/dir/code.sh endif Any piece of suggestions how to convert it to sh way? Thank you emily (5 Replies)
Discussion started by: emily
5 Replies

2. Shell Programming and Scripting

Issues with awk and tcsh

Hello experts, I have two files which I'm uploading. One is an awk script and other file acts as an input to the script via positional parameter. awk -f intlmenu.awk jobsq.txt This run fine in C shell on SCO OpenServer Release 5.0.7. When I run it on Solaris 10 ( tcsh shell ) I get... (2 Replies)
Discussion started by: maverick_here
2 Replies

3. Shell Programming and Scripting

Help in tcsh script

Hi All, I wrote a tcsh script, but being a beginner it took me lots of efforts and on top of that I am still struggling with little modifications here and there. kindly have a loop. Line1 : I want it to run maximum of "Max" Which I am providing outside loop. So how the "for" should be... (10 Replies)
Discussion started by: nrjrasaxena
10 Replies

4. Shell Programming and Scripting

perl in tcsh

hi, I am completely new for tcsh scripting. Trying to write a code, need to implement following function there, perl -pi.bak -e 's/filei/file(i+1)/g' data I want the "i" to increment and this should change the file name as i = 1; file1->file2 i=2; file2->file3 and so on also... (4 Replies)
Discussion started by: nrjrasaxena
4 Replies

5. Shell Programming and Scripting

tcsh help

Does anyone no way my .tcsh_history file is filling up with a bunch of crap?? It is filled with lines like: ! ls eccracrascratcd ! ls mecd /hchoo "cratch2/mecd /sch2/mecd /sh2/mecd /scratchcd /scratch2/mecd /scratcraecd /ls mo "ls" > ! ls eccratch2/mecd /sc/ls"d /scratch2/mecd histecho "ls" o... (2 Replies)
Discussion started by: Bic121
2 Replies

6. Shell Programming and Scripting

logging out in tcsh

Hi! I want to log out of the tcsh shell without updating the history? Thanks, Jack. (3 Replies)
Discussion started by: jacki
3 Replies

7. Shell Programming and Scripting

for / foreach syntax issues (in bash or tcsh)

So I am new to unix, and actually anything outside drag and drop with the mouse (been learning for about a week so far) . I have been using the foreach command in tcsh because I am working on a group of files. Basically what I need is to insert part of the filename as the first line in the file.... (0 Replies)
Discussion started by: thepolypore
0 Replies

8. UNIX for Dummies Questions & Answers

About tcsh shell

Hello, Why tcsh shell is not recommended ? then which one is better ? Also can you please let me know how to change own shell and config file? (3 Replies)
Discussion started by: darshakraut
3 Replies

9. UNIX for Dummies Questions & Answers

help in tcsh

am working in tcsh while writing a script, what is diff between foll two starting line #!/bin/csh #!/bin/csh -f Also can I use the same line for script in tcsh or I have to necessarily use #!/bin/tcsh I guess even #!/bin/sh will also do. Kindly clarify (3 Replies)
Discussion started by: mahendrakamath
3 Replies

10. Shell Programming and Scripting

tcsh

I'm working on OpenOffice Localization; In that I need to work most of in 'tcsh' Since I have almost work till now in 'bash', I want to explore 'tcsh' much more .. An body suggest me a way ? books ? Thanks, :) (1 Reply)
Discussion started by: kartik
1 Replies
Login or Register to Ask a Question