Jacob Anderson
Jacob Anderson

Reputation: 45

Arithmetic in tsch

I am working on updating a script to append the loop number iteration to a filename. However I can't find any documentation that will help me update the variable value. Instead, it appends the operation as a string.

(base) me@axoneme:~$ tcsh
axoneme:~> set j=100
axoneme:~> set j=$j+1
axoneme:~> echo $j
100+1

How can I do arithmetic in tcsh such that the 102nd loop will just be set j= $j + 1 where $j =101

Upvotes: 0

Views: 94

Answers (1)

Jacob Anderson
Jacob Anderson

Reputation: 45

@ sign seems to be used in tcsh

axoneme:~> set j = 100
axoneme:~> @ j = 100 + 1
axoneme:~> echo $j
101

Upvotes: 1

Related Questions