LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-16-2007, 10:33 AM   #1
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Rep: Reputation: 0
repeating command


hi,
does any one can tell me what is command for repeating.. for example if i want to repeat every 12 . sample: 2+ 12=14.. 14+12=26....so on.. Is there any way to repeat every 12 rather then adding +12 every time?

Thanks
 
Old 10-16-2007, 12:52 PM   #2
reverse
Member
 
Registered: Apr 2007
Distribution: Gentoo
Posts: 337

Rep: Reputation: 30
All I can say to that is: LOLWUT!?
 
Old 10-16-2007, 12:56 PM   #3
The_JinJ
Member
 
Registered: Apr 2004
Location: Scotland
Distribution: Suse, OpenWRT
Posts: 299

Rep: Reputation: 30
I ain't a master scripter but this would do it - ok so not a command

Code:
#!/bin/bash
L=10
N=2
for (( i=2; i<L; i++ )); do
  n=$((n+12))
  t=$(($n + $N))
  echo $n "plus" $N "=" $t
done
 
Old 10-20-2007, 06:18 PM   #4
monu
LQ Newbie
 
Registered: Jun 2007
Posts: 17

Original Poster
Rep: Reputation: 0
I have figured it out.. Thanks anyways
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
repeating the command ekdya Debian 2 03-31-2006 04:47 PM
L 99 99 99 99 repeating lockup bobby_hawk Slackware 12 01-05-2006 02:58 AM
traceroute command AND repeating the destination in output dan99 Linux - Networking 1 01-22-2005 10:00 PM
Repeating % in startup - Ubuntu dcubed20 Linux - Software 1 01-11-2005 02:01 AM
Suse v9.2 Install - Repeating 1s muppetmaster Linux - Software 7 01-02-2005 10:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration