${name${i}} problem in CSH


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ${name${i}} problem in CSH
# 1  
Old 09-23-2008
${name${i}} problem in CSH

Hello all,

I tried the following commands in the cshell, but failed.
Code:
~Cshell %set i=2
~Cshell %set fields${i}= ( ad dd dd )
~Cshell %echo $fields${i}
fields: Undefined variable.
~Cshell %echo ${fields${i}}
Missing }.

And i can see the $fields2 is already set as a local variable
Code:
~Cshell %set |grep fields2
fields2 (ad dd dd)

How can I retrieve the contents of fields2??

PS: I want to use this function to do like dynamically creating the objects as an array.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk execution problem in csh

This has no error awk '($8==150) && ($4>=11.001 && $4 <= 12) && ($5>=91.001 && $5<=92){print}' OFS="\t" file following are unable to run in csh this is giving error awk: line 1: syntax error at or near not even working in terminal awk '($'$gr'=='$grn') && ($'$ll'>='$Y' && $'$ll' <= '$Ym')... (1 Reply)
Discussion started by: nex_asp
1 Replies

2. Shell Programming and Scripting

Csh variable calling problem

First post on here. So I use csh shells for my research (physics... not a CS person). I am trying to rerun the same scripts, but there are ~10 files that have similar variables that I have to change for each different configuration, so I would like one central file for the variables I change that... (3 Replies)
Discussion started by: sabrepride
3 Replies

3. UNIX for Dummies Questions & Answers

Problem with simple csh scripting

I found my answer... (2 Replies)
Discussion started by: sjung9442
2 Replies

4. Shell Programming and Scripting

CSH missing - problem

Hi all, i need help with this code set login = (`cut -d ":" -f1 /etc/passwd.2001`) set group = (`cut -d ":" -f4 /etc/passwd.2001`) set name = (`cut -d ":" -f5 /etc/passwd.2001 | cut -d ":" -f1`) set i = 1 while ($#login > 0) set pom = `last $login | wc -l` if ($pom < 3) then... (1 Reply)
Discussion started by: Casualty
1 Replies

5. Shell Programming and Scripting

Execution problem with csh script

Hi All, I have a small issue with my csh script which I am using to FTP a file. What I know is...there are two commands to execute script.. 'sh <file>' & '\<file>'. When I execute my script with command 'sh <file>', it gives me syntax error while it runs successfully with command '\<file>'. I am... (3 Replies)
Discussion started by: ndd
3 Replies

6. Shell Programming and Scripting

Problem with endsw in csh

I am getting an error and can't figure out the problem breaksw: endsw not found. Problem has been solved now (0 Replies)
Discussion started by: kristinu
0 Replies

7. Shell Programming and Scripting

Problem with csh script

Hi All, I have the following script. #!/bin/csh # # createDATfile.sh # cd /export/home/fastserv/bin source /export/home/fastserv/bin/dbenv.sh echo `date` >> /export/home/fastserv/bin/log.txt echo "%INF% Starting send of current FASTSERVICE batch" >>... (4 Replies)
Discussion started by: rahulrathod
4 Replies

8. Shell Programming and Scripting

csh problem with while

Hello this my first post, so i hope you help me echo -n "Choose which square you want to hit of PL2 grid " set pl2_square = $< set i = 1 while ($i <= 6) if ($pl2_square == $pl2_ships) then $pl2_ships = x echo "" echo "" echo "PL1 has hitted a square of PL2" echo... (5 Replies)
Discussion started by: amaj1407
5 Replies

9. Shell Programming and Scripting

Problem accessing csh ?? (Newbie)

Hi All, Just recently started using a program in Unix for a client. I was sent a script to use but for some reason it's not working. The person who created the script first suggested I may need to edit the first line of the script so that it has the correct path for the csh file: #!/bin/csh -f... (3 Replies)
Discussion started by: gmalt
3 Replies

10. Shell Programming and Scripting

cron job problem with csh script

I've written a csh shell script to number each line of a file. Firstly, the program count the number of the file and create a file with number at the front. Then, combine the file together. when i call the program manually, it works.However, when i set it in the cronjob, the output always leaves... (3 Replies)
Discussion started by: fung_donald
3 Replies
Login or Register to Ask a Question
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)