Sponsored Content
Full Discussion: Bash script - loop question
Top Forums Shell Programming and Scripting Bash script - loop question Post 302828051 by nitrohuffer2001 on Monday 1st of July 2013 01:25:41 PM
Old 07-01-2013
Hi,

Thanks for the response!

Advice taken.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

loop does not execute in bash script?

I have a very basic bash shell script, which has many "while... done; for .... done" loop clauses, like the following ~~ #!/bin/bash while blablalba; do .... done < /tmp/file for line in `cat blablabla`; do grep $line /tmp/raw ; done > /tmp/1; while blablalba2; do .... done <... (2 Replies)
Discussion started by: fedora
2 Replies

2. Shell Programming and Scripting

error in bash script 'if' loop

SEND_MESSAGE=test echo $SEND_MESSAGE if then echo `date` > update_dt_ccaps.lst echo "The file transfer failed" >> update_dt_ccaps.lst SEND_MESSAGE=false fi The above code is showing error in bash shell as : ./test: line 5: [: test: integer expression expected ... (2 Replies)
Discussion started by: DILEEP410
2 Replies

3. Shell Programming and Scripting

BASH loop inside a loop question

Hi all Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Discussion started by: rethink
4 Replies

4. Shell Programming and Scripting

Getting error on for loop - bash script

Hi, I am working on bash script after a long time. I am getting error near done statement while running a for loop snippet. The error says "Syntax error near unexpcted token 'done'" please suggest what could be wrong. here is the snippet elements=${#option_arr} //an array of values... (1 Reply)
Discussion started by: arundhati_s
1 Replies

5. Shell Programming and Scripting

Expect script called in loop from Bash Script

Having issues with an expect script. I've been scripting bash, python, etc... for a couple years now, but just started to try and use Expect. Trying to create a script that takes in some arguments, and then for now, just runs a pwd command(for testing, final will be command I pass). Here is... (0 Replies)
Discussion started by: cbo0485
0 Replies

6. Shell Programming and Scripting

Bash Question: HowTo Exit Script with User Input While Process is Running Mid-Loop?

Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies

7. Shell Programming and Scripting

While loop with input in a bash script

I have the following while loop that I put in a script, demo.sh: while read rna; do aawork=$(echo "${rna}" | sed -n -e 's/\(...\)\1 /gp' | sed -f rna.sed) echo "$aawork" | sed 's/ //g' echo "$aawork" | tr ' ' '\012' | sort | sed '/^$/d' | uniq -c | sed 's/*\(*\) \(.*\)/\2: \... (3 Replies)
Discussion started by: faizlo
3 Replies

8. Shell Programming and Scripting

How to use grep in a loop using a bash script?

Dear all, Please help with the following. I have a file, let's call it data.txt, that has 3 columns and approx 700,000 lines, and looks like this: rs1234 A C rs1236 T G rs2345 G T Please use code tags as required by forum rules! I have a second file, called reference.txt,... (1 Reply)
Discussion started by: aberg
1 Replies

9. UNIX for Beginners Questions & Answers

Help with date in bash script for loop from YYYYMMDDHHMM

Hi everyone I need some help I want to create an script which does some processing it takes the two arguments 201901010000 and 201901020200 - so YYYMMDDHHMM I want to split processing into hours from start until end, I dont get why this works but when I add to a future variable... (1 Reply)
Discussion started by: kl1ngac1k
1 Replies

10. UNIX for Beginners Questions & Answers

Help with a bash loop script

Create a single bash script that does the following: a. Print out the number of occurrences for each motif that is found in the bacterial genome and output to a file called motif_count.txt b. Create a fasta file for each motif (so 3 in total) which contains all of the genes and their... (6 Replies)
Discussion started by: dre
6 Replies
Aspect::Advice::Before(3pm)				User Contributed Perl Documentation			       Aspect::Advice::Before(3pm)

NAME
Aspect::Advice::Before - Execute code before a function is called SYNOPSIS
use Aspect; before { # Trace all calls to your module print STDERR "Called my function " . $_->sub_name . " "; # Shortcut calls to foo() to always be true if ( $_->short_name eq 'foo' ) { return $_->return_value(1); } # Add an extra flag to bar() but call as normal if ( $_->short_name eq 'bar' ) { $_->args( $_->args, 'flag' ); } } call qr/^ MyModule::w+ $/ DESCRIPTION
The "before" advice type is used to execute advice code prior to entry into a target function. It is implemented by Aspect::Advice::Before. As well as creating side effects that run before the main code, the "before" advice type is particularly useful for changing parameters or shortcutting calls to functions entirely and replacing the value they would normally return with a different value. Please note that the "highest" pointcut (Aspect::Pointcut::Highest) is incompatible with "before". Creating a "before" advice with a pointcut tree that contains a "highest" pointcut will result in an exception. If speed is important to your program then "before" is particular interesting as the "before" implementation is the only one that can take advantage of tail calls via Perl's "goto" function, where the rest of the advice types need the more costly Sub::Uplevel to keep caller() returning correctly. AUTHORS
Adam Kennedy <adamk@cpan.org> COPYRIGHT AND LICENSE
Copyright 2010 Adam Kennedy. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-01 Aspect::Advice::Before(3pm)
All times are GMT -4. The time now is 03:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy