LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-24-2009, 02:56 AM   #16
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983

Quote:
Originally Posted by mivison View Post
yes i did and there seems to be a problem with that command on my eeepc. i am running puppy 4.20 on that netbook. i wonder what the problem could be?
Please be more specific. Every time you encounter an error and ask for help, tell us the content of the script, the exact command line used and the copy/pasted output and errors you see in the terminal. And please use the code tags to embed the code, to preserve spaces, indentation and so on (code tags are those you get if you select some text and click on the "#" button in Advanced Mode).
 
Old 05-24-2009, 12:18 PM   #17
mivison
LQ Newbie
 
Registered: Jan 2007
Location: Kennedale,Texas
Distribution: Mepis,Puppy
Posts: 22

Original Poster
Rep: Reputation: 15
when i run this sample script on with my original puppy disto it stops at line 4 and keeps looping an error message over and over again. i put a second install on my netbook and run the sample script, it runs good. tried the sample script on 2 different machines (same disto puppy 4.1)and no problems. something is corrupt in the install. i'm going to uninstall that distro.

sample script:

#!/bin/bash
number=0
until [ $number -ge 100 ]
do
echo $number
((number++))
done
 
Old 05-24-2009, 12:36 PM   #18
mivison
LQ Newbie
 
Registered: Jan 2007
Location: Kennedale,Texas
Distribution: Mepis,Puppy
Posts: 22

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by chrism01 View Post
It sounds like you have a list of records in save.txt that you want automatically processed, without human interaction:
Code:
IFS="
" # ie put a single <return> in between the quotes
for rec in `cat save.txt`   # backquotes, not single quotes
do
    nohup transcribe $rec &    # nohup plus & enables you to logout of this session without breaking it
done
yes that is what i am trying to do. i will try this routine in the next couple of days i am at work right now. also i messed around with these 2 lines and they both worked for what i want to do. they would execute 1 line at a time and stop at the last line.

transcribe $(sed -n -e '/1/,/100/p' save.txt) &

transcribe $(head -n100 save.txt) &

thanks
 
Old 05-24-2009, 01:23 PM   #19
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
Quote:
with my original puppy disto it stops at line 4
Is bash a symlink to another shell, or is it really bash -and which version?
If your loop is sticking try using a different syntax like this:
Code:
/bin/bash
IFS="
"
while read line ; do
  transcribe "$line" &
done <save.txt
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: replace a line in text file freeindy Programming 10 09-08-2011 12:08 PM
Deleting empty line at end of text file in BASH human2.0 Linux - General 8 04-01-2009 02:44 AM
bash : read every line from text file starting at given line number quadmore Programming 4 02-20-2009 12:29 PM
bash - read or write to specific line in text file? babag Programming 11 08-23-2008 01:44 PM
how to change some text of a certain line of a text file with bash and *nix scripting alred Programming 6 07-10-2006 11:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:07 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
Open Source Consulting | Domain Registration