Does ${%name} exist in csh?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Does ${%name} exist in csh?
# 1  
Old 01-10-2012
Does ${%name} exist in csh?

I have this code in tcsh and would like to know whether the syntax below will work in csh.

Code:
if( "${%rsl}" == 0 ) then
  echo "rsl is empty"
endif

---------- Post updated at 06:38 AM ---------- Previous update was at 05:53 AM ----------

It does not seem so. Perhaps the best thing is to pipe the variable to awk and use length.
# 2  
Old 01-10-2012
It gives a syntax error in "csh".

You seem to be hitting limitations of "tcsh" daily. It is really not suitable for systems work.

Have you considered changing to a Bourne-like Shell? Most Systems Administrators use the same Shell as is used for their system-supplied "rc" scripts.
# 3  
Old 01-10-2012
Yes, I have been changing some of the scripts to ksh.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Why does a fakechroot exist?

I am really confused as to why a tool like fakechroot exists and what does it do. Chroot is an ability only for root users, correct? Then a tool that allows to bypass that is clearly a security flaw, correct? When and why would you need something like this? Is there any relation between... (7 Replies)
Discussion started by: sreyan32
7 Replies

2. UNIX for Beginners Questions & Answers

Check if 10 files exist

Hi All, Whenever i get 10 files(file names like sales*) then another file need to create. May i know how to implement this in KSH. (4 Replies)
Discussion started by: siddireddy
4 Replies

3. Shell Programming and Scripting

Determine the exist status

Hi, i am a novice in scrpting and need your help on the following. i have a script that checks if a file exists: if ; then echo " Files exists" else echo " file not found" fi assuming the files does not exist ,, the script when run dusplays " file not found".. so far true. but when i... (2 Replies)
Discussion started by: sbk785
2 Replies

4. Shell Programming and Scripting

IF statement file exist or not?

How can I check and see if the first parameter is a file existing in the current path or it is a real file and user input some random name in an IF statement? (5 Replies)
Discussion started by: bashily
5 Replies

5. Shell Programming and Scripting

if pid exist ?

Hi I need help to whit a script that start a program if a nother program is started first . I thought something like this . if then start program 2 Thanks (4 Replies)
Discussion started by: pelle
4 Replies

6. Shell Programming and Scripting

Find out whether files exist.

I have the following data stored in a file. 1 /home/file13 /home/file2 2 /home/file41 /home/file654 3 /home/file61 /home/file45 4 /home/file81 /home/file43 ... I want to print the first column provided the files represented by the second and third column exist. How to do that? (3 Replies)
Discussion started by: kevintse
3 Replies

7. Shell Programming and Scripting

check the directory exist

I have the below script to check whether directory is exist or not , now I sure the directory /abc NOT exist , but when run the script , it still pop the result is "the directory exist" , could suggest what is wrong ? thx ll -d /abc > /dev/null 2>&1 if then echo "the directory exist !!" ... (7 Replies)
Discussion started by: ust
7 Replies

8. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies

9. UNIX for Dummies Questions & Answers

su: user x does not exist

somehow my user names and groups on one of our machines are changed to numbers 700, 701, etc. thus, i can only ssh into this machine as root. is there a way to migrate the user names and groups to this machine? thanks! (3 Replies)
Discussion started by: user23
3 Replies

10. UNIX for Dummies Questions & Answers

does it exist in linux?

Is there a jumpstart equivalent tool in the linux environment? (1 Reply)
Discussion started by: pbonilla
1 Replies
Login or Register to Ask a Question