show dots when script is "thinking"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting show dots when script is "thinking"
# 8  
Old 05-07-2010
hmm still not working
# 9  
Old 05-07-2010
Quote:
Originally Posted by pkohn11
hmm still not working
That's not much help; in what way is it not working?
# 10  
Old 05-07-2010
Code:
#!/bin/bash

kjv=kjv.txt
trim(){
	local trim_string
	local _TRIM=$1
	trim_string=${_TRIM##*[${2:- }]}
	_TRIM=${_TRIM#"trim_string"}
	echo $_TRIM
}

#trim() {
#	echo $( _trim "$@" )
#}

printf "How many chapters? "
read response

line_count=0
blocksize=1000
while IFS=: read book chapter verse text
do
    line_count - `expr $line_count + 1`
    if [ $line_count -gt $blocksize ]
      then 
         echo ".\c"
         line_count=0
     fi
    #this is a temp variable!
    chapterCount=$response
    chapterNumber=$( trim "$chapter" 0 )
    if [ $chapterNumber -le $chapterCount ]
    then 
        firstword=${text%% *}
        printf "%s %s:%s %s\n" "$book" "$chapter" "$verse" "$firstword"
    fi
done < "$kjv"

returns the following error:
/home/administrator/bin/pk8-1-test: line 27: line_count: command not found
# 11  
Old 05-07-2010
As I see it, the problem is at line 23, not 27.

Code:
line_count - `expr $line_count + 1`

and at line 32 (testing result of call to trim function), which doesn't return anything.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

Can someone please show me a very simple "expect" script to change password in Solaris please?

Ladies & Gents, Can one of you gurus please show me a very simple "expect" script to change the password in Solaris in a script, please? Nothing fancy, no error checking, no nothing. Just to change the password of a new user, it's all. Many thanks in advance. U guys have honestly earned my... (1 Reply)
Discussion started by: Hiroshi
1 Replies

3. Red Hat

"/usr/sbin/hpacucli ctrl all show" command does not work

Dear Concern, We have observed that following command stuck/does not work in some RedHat nodes. Please advise us to troubleshoot the issue. /usr/sbin/hpacucli ctrl all show Note: HP Array Configuration Utility CLI for Linux 64-bit With Best Regards, Md. Abdullah-Al Kauser (3 Replies)
Discussion started by: makauser
3 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

Awk-sed - wc : how to count DOTS "."'s in a file.

Hi Experts , file: EST 2013::.................................................................................................................................................................................................................................................cmihx021:/home/data1/ ... (11 Replies)
Discussion started by: rveri
11 Replies

6. Shell Programming and Scripting

perl - Removing dots(".") from the data

Hi Friends, I have a file1 as below file1.txt 100000.||1925-01-10|00:00|1862SHERMA NAVE#1SE.||EVTON|IL|60201||22509.|BDSS|62007|2639.|26670 100001.||1935-01-10|00:00|1862NEW . YRK NO.||EVTON|IL|60201||22509.|BDSS|62007|2639.|26670. 100002.||1965-01-10|00:00|1862 IND . INC,CL... (6 Replies)
Discussion started by: i150371485
6 Replies

7. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question