Start New Discussion Reply to this Discussion for loop in vi editor in ubuntu
can any body give me the correct syntax of for loop to be used in vi editor in ubuntu.....
i know like this....:-
for (( initialisation;condition;increment ))
do
"statements for do"
done
Related Article: infinite loop causing program to crash
is a Software Development discussion thread by raphael1 that has 4 replies, was last updated 4 months ago and has been tagged with the keywords: c++, win32, gdi.
vinay7868
Light Poster
32 posts since Aug 2012
Reputation Points: 0
Solved Threads: 1
Skill Endorsements: 0
hi,
can you be more precise about what your trying to do?
what's the goal of the for loop?
are you writing a vi script, or are you using vi to write a shell script?
Watael
Junior Poster
121 posts since Apr 2012
Reputation Points: 4
Solved Threads: 26
Skill Endorsements: 2
echo "Pattern1"
for (( $i=0;$i<=5;$i++ ))
do
for (( $j=0;$j<=i;$j++ ))
do
echo $j;
done
echo "";
done
//i want to print a pattern but it gives me a for syntax error......
vinay7868
Light Poster
32 posts since Aug 2012
Reputation Points: 0
Solved Threads: 1
Skill Endorsements: 0
for (( i=0; i<=5; i++ ))
i=0 is an assignment, as is i++ inside double parenthesis.
Watael
Junior Poster
121 posts since Apr 2012
Reputation Points: 4
Solved Threads: 26
Skill Endorsements: 2
vinay7868
Light Poster
32 posts since Aug 2012
Reputation Points: 0
Solved Threads: 1
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page rendered in 0.5175 seconds
using 2.64MB