Conditional structures: Difference between revisions

Add Ed conditionals
(Add Ed conditionals)
Line 2,501:
print i & " is not divisible by 2 or 3"
.
</syntaxhighlight>
 
=={{header|Ed}}==
 
Note that ed, unlike more advanced [[Sed]] has no conditional branching. Still, conditionals can be simulated with global match/no-match rules:
 
<syntaxhighlight lang="bash">
g/True/s//It's true!/p
v/True/s/.*/It's false!/p
</syntaxhighlight>
 
73

edits