LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-14-2014, 02:58 PM   #1
Bobbyyyy
LQ Newbie
 
Registered: Apr 2014
Posts: 4

Rep: Reputation: Disabled
Is this the write way to write a 2 command loop script?


Okay, I just wanted to know if this would run 2 commands and loop. If not could you help me out with rearranging or adding things in.

#!/bin/bash
while :
do
command1
sleep 1
command2
sleep 1
done

So would this work?
 
Old 04-14-2014, 03:03 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Keep it to one thread:
http://www.linuxquestions.org/questi...lp-4175501602/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a script containg more than 1 command ahmed_as8 Linux - Newbie 10 04-10-2012 01:07 PM
How write a script with AT command for modem enaud Linux - Hardware 26 03-28-2012 09:53 AM
How to write a loop command for pdf2djvu tjcarol Linux - General 3 06-28-2011 01:47 PM
read/write,write/write lock with smbclient fails swatidas11 Linux - Networking 1 03-10-2010 01:27 PM
Trying to write a bash script -- :Command not found? bpottle Linux - Software 7 06-10-2006 07:11 PM


All times are GMT -5. The time now is 01:05 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration