Sponsored Content
Top Forums Shell Programming and Scripting show dots when script is "thinking" Post 302419586 by pkohn11 on Friday 7th of May 2010 02:30:42 PM
Old 05-07-2010
show dots when script is "thinking"

Hey, I'm running the following script:

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

while IFS=: read book chapter verse text
do
    #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"
printf "\n"

Basically it takes the first word out of each verse of a specified amount of chapters from a text file. Since the file is so large it takes some time and sometimes looks like its stuck. How can I add dots (periods) or something of that nature every time it's "thinking"?
 

8 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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
SERVICE(8)						    BSD System Manager's Manual 						SERVICE(8)

NAME
service -- control (start/stop/etc.) or list system services SYNOPSIS
service -e service -R service [-v] -l | -r service [-v] <rc.d script> start|stop|etc. DESCRIPTION
The service command is an easy interface to the rc.d system. Its primary purpose is to start and stop services provided by the rc.d scripts. When used for this purpose it will set the same restricted environment that is in use at boot time (see below). It can also be used to list the scripts using various criteria. The options are as follows: -e List services that are enabled. The list of scripts to check is compiled using rcorder(8) the same way that it is done in rc(8), then that list of scripts is checked for an "rcvar" assignment. If present the script is checked to see if it is enabled. -R Restart all enabled local services. -l List all files in /etc/rc.d and the local startup directories. As described in rc.conf(5) this is usually /usr/local/etc/rc.d. All files will be listed whether they are an actual rc.d script or not. -r Generate the rcorder(8) as in -e above, but list all of the files, not just what is enabled. -v Be slightly more verbose ENVIRONMENT
When used to run rc.d scripts the service command sets HOME to / and PATH to /sbin:/bin:/usr/sbin:/usr/bin which is how they are set in /etc/rc at boot time. EXIT STATUS
The service utility exits 0 on success, and >0 if an error occurs. EXAMPLES
The following are examples of typical usage of the service command: service named status service -rv The following programmable completion entry can be use in bash(1) for the names of the rc.d scripts: _service () { local cur cur=${COMP_WORDS[COMP_CWORD]} COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) ) return 0 } complete -F _service service SEE ALSO
bash(1) (ports/shells/bash), rc.conf(5), rc(8), rcorder(8) HISTORY
The service utility first appeared in FreeBSD 7.3. AUTHORS
This manual page was written by Douglas Barton <dougb@FreeBSD.org>. BSD
December 11, 2012 BSD
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy