LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-01-2014, 05:47 AM   #1
linuxonbute
Member
 
Registered: May 2005
Location: North lincolnshire
Distribution: Mint 18 Cinnamon
Posts: 47

Rep: Reputation: 19
Problem with for loop in bash


I have written this:
[code]
#!/bin/bash
uvccapture -m
for x in 1 2 3 4 5
uvccapture -m
sleep 5
done
[\code]
the uvccapture -m on line 2 runs but inside the loop it fails with the following error:
line 4: syntax error near unexpected token `uvccapture'

line 4: `uvccapture -m'

I cannot figure out why this happens. Any ideas please?
 
Old 11-01-2014, 05:59 AM   #2
linuxonbute
Member
 
Registered: May 2005
Location: North lincolnshire
Distribution: Mint 18 Cinnamon
Posts: 47

Original Poster
Rep: Reputation: 19
Re Problem with for loop in bash

How stupid am I?
VERY
#!/bin/bash

uvccapture -m
for x in 1 2 3 4 5;
do
uvccapture -m
sleep 5
done
[\code]
works fine
 
  


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
problem with loop bash ofer4 Linux - Newbie 10 04-07-2012 05:52 PM
[Bash] Problem with arguments in loop en1du Programming 6 10-26-2011 07:53 AM
[SOLVED] Formating problem in bash while loop k_balaa Linux - Newbie 9 09-01-2011 10:42 AM
bash while loop problem MadMusician_uk Programming 3 04-20-2006 12:52 PM
bash for loop problem deadlock Programming 5 09-04-2003 05:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:58 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