tcsh Controlling Expression Question

tcsh Controlling Expression Question

Post by <j.. » Sat, 22 Sep 2001 01:44:16



This, in bash, is what I'm trying to do in tcsh:

Quote:> for i in * ; do echo $i ; done

I know how to use the foreach command to do it similarly:
Quote:> foreach i ( * )

?> echo $i
?> end

but this way makes me write the foreach statements on seperate lines. Is it
possible to do it in the same fashion as in bash? (ie: on one line)

thanks

 
 
 

tcsh Controlling Expression Question

Post by Robert Mane » Sat, 22 Sep 2001 03:18:17


[snip]

Quote:> I know how to use the foreach command to do it similarly:
>> foreach i ( * )
> ?> echo $i
> ?> end

> but this way makes me write the foreach statements on seperate lines. Is it
> possible to do it in the same fashion as in bash? (ie: on one line)

Sure!


Quote:> thanks

Greets, Rob

--
Sig under construction.

 
 
 

tcsh Controlling Expression Question

Post by <j.. » Sat, 22 Sep 2001 14:17:53


Um did you try out the syntax you sent me? And you are using tcsh as your
shell?

Quote:> foreach i ( * ) { echo $i ; }

i: Undefined variable.



> [snip]

> > I know how to use the foreach command to do it similarly:
> >> foreach i ( * )
> > ?> echo $i
> > ?> end

> > but this way makes me write the foreach statements on seperate lines. Is
it
> > possible to do it in the same fashion as in bash? (ie: on one line)

> Sure!


> > thanks

> Greets, Rob

> --
> Sig under construction.

 
 
 

1. tcsh Controlling Expressions Syntax

This, in bash, is what I'm trying to do in tcsh:

I know how to use the foreach command to do it similarly:
?> echo $i
?> end

but this way makes me write the foreach statements on seperate lines. Is it
possible to do it in the same fashion as in bash?

thanks

2. 5.04 on a 486 with 32M

3. Regular Expressions not alwas working in tcsh

4. strange Waiting for IO numbers

5. * Quoting that expression as an tcsh-alias ?

6. Debian 1.3 Beta Test, and other Debian News

7. tcsh simple if expression...

8. Linux=>internet via NT-proxy

9. tcsh/csh expression alias redone for bash

10. How to test for regular expression matches in tcsh?

11. Regular Expressions not alwas working in tcsh

12. tcsh job control

13. Problems with job control and tcsh