`ls -l`: Ambiguous


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting `ls -l`: Ambiguous
# 1  
Old 05-28-2007
`ls -l`: Ambiguous

Hi,
I'm trying to code a simple script (c-shell) on a Solaris box and I'm getting an "Ambiguous" error. These are the lines that cause the error:

On c-shell:

> set var = ""
> @ var = `ls -l`
`ls -l`: Ambiguous

However if I change the second line to:

> set var = `ls -l`

This works ok but I'm not sure why. I believe and I may be wrong that to change the value of an already defined variable I should use the syntax as in my first example (@ var = X) but there is obviously something that I'm not understanding very well. This may be only for numerical calculations. Please I accept any comment about this error.

Thanks!

Guillermo
# 2  
Old 05-28-2007
Go through this link. I suggest you move to bash/ksh for your scripting needs.
# 3  
Old 05-29-2007
Thanks man!
I'm aware about the inconvenience about coding in csh but I'm working on a project that is all coded in csh so I must follow these rules. I'm working on the migration but is a whole back end and I this could not be done right now as it'll consume a lot of time, effort and money. That's the consequence of bad decisions in the past but I can't do anything about it :-).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

$1”: ambiguous redirect

New to the site, please let me know I'm not meeting the post guidelines. I'm creating a bash script to generate a report with output from a grep command. The goal is to direct the output to a different log file by using a 'logger file'. But I get this error during the run: $1: ambiguous... (5 Replies)
Discussion started by: dallas88
5 Replies

2. Shell Programming and Scripting

Ambiguous output redirect in xterm

Hi all, I've been working on a bash script to help with backups that I have to do at work. One of the lines in the script is supposed to launch an xterm, log into a specific server node and launch a tar backup to tape. This part works ok, but I've been trying to get stdout and stderr to... (2 Replies)
Discussion started by: Exitalterego
2 Replies

3. Red Hat

ISO C++ ambiguous error

String.h has the following operator overloading function which is an user defined //declaration int operator==(char *ch) //definition int String::operator==(char *ch) { if (strcmp(_text, ch) == 0) { return TRUE; } else { ... (4 Replies)
Discussion started by: dany2704
4 Replies

4. Shell Programming and Scripting

Ambiguous error

Hello everybody, I just took over this job from someone else and in the past this script they built worked but i recently upgraded from openSuSe 11.4 to 12.1 Now when i run the script i get an ambiguous error at line 25 (the first line after add() ) I have edited out the webpath and any... (1 Reply)
Discussion started by: gumbicus
1 Replies

5. UNIX for Dummies Questions & Answers

Ambiguous command

I have run the following command and getting $fout: Ambiguous. set fout = `echo "$fnameLst" | awk '{gsub(/-dc*/,""); print}' | sort -u` (2 Replies)
Discussion started by: kristinu
2 Replies

6. Shell Programming and Scripting

ambiguous redirect error

This script has ambiguous redirect error. ... cd $HOME cd folder/work # search all subfolders in work directory find -mindepth 1 -maxdepth 1 -type d | while read directory do CUR_FOLDER="${directory#"./"}" cd $CUR_FOLDER chmod 644 * for ff in *; do if ; then ... (5 Replies)
Discussion started by: candyme
5 Replies

7. Shell Programming and Scripting

Ambiguous redirect

Hello there, I'm totally new in bash programming and ran into my first problem. My script should generate 3 textfiles where the content of the first and the third row are the same in each file. Only the second row is different. This is what I did in a very simplified explanation: ... (6 Replies)
Discussion started by: johndoe
6 Replies

8. UNIX for Dummies Questions & Answers

ambiguous redirect issue

I am trying to run the following script and I am getting an "ambiguous redirect" error. I have checked to make sure that the files are all where I have specified and are read/write as needed. Any ideas? Note: I have removed the actual path info for privacy sake. I have triple checked to make... (1 Reply)
Discussion started by: malantha
1 Replies

9. Shell Programming and Scripting

Ambiguous output redirect error

Hi everyone, While I was trying to do DATE=`date +"%Y%m%d_%H%M%S"` STARTLOG=$TUXSTDDIR/start_$DATE.log tmboot -y > $STARTLOG 2>&1 I got an error i.e. Ambiguous output redirect error. Here the first part is to boot the account so there is nothing wrong with that.... (6 Replies)
Discussion started by: pareshan
6 Replies

10. UNIX for Dummies Questions & Answers

ambiguous redirect

i have following statement in the script echo -e "$str_XML_col_name:$str_field_type;" >> $i_DC_Key_$i_Tgt_DC_key_Schema here $i_DC_Key is DC key and $i_Tgt_DC_key are the variables............... when i ran the script i am getting error rec_merge.sh: $i_DC_Key_$i_Tgt_DC_key_Schema:... (1 Reply)
Discussion started by: mahabunta
1 Replies
Login or Register to Ask a Question