Sponsored Content
Full Discussion: Looping advice
Top Forums Shell Programming and Scripting Looping advice Post 302748253 by Yoda on Tuesday 25th of December 2012 01:40:18 AM
Old 12-25-2012
Code:
#!/bin/bash

counter=10

while true
do
        if [ $counter -eq 56 ]
        then
                counter=10
        fi

        echo $counter

        counter=$(( counter + 1 ))
done

 

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Looking for some advice

I am looking for some advice on wether to use unix or red hat linux? I have played with most windows OS and Mac OS up to in and including OS X. any and all advice would be appreciated (4 Replies)
Discussion started by: justawind
4 Replies

2. UNIX for Dummies Questions & Answers

Need advice: Awk vs something else?

I have a while read loop cycling through a fixed-length csv file and I'd like to use an if statement to check two fields in each line. I'm basically asking for your suggestions on the best and easiest way to check two fields in each line. I'm sure many of you may be thinking just use awk, but if... (1 Reply)
Discussion started by: yongho
1 Replies

3. Shell Programming and Scripting

looking for advice...

Hi. First of all, Im an msoft guy, and when it comes to linux/unix, I'm retarded. Here is what I'm trying to do. I want to start I want to automatically connect to a remote server. Then I need it to login(https) -insert the licensce in the box(vi) -based on that licensce, the... (1 Reply)
Discussion started by: bravo24601
1 Replies

4. Shell Programming and Scripting

Script Advice please?

Ok. I want to parse a log file and search only for denied traffic for the previous hour. The log looks like this: Jun 18 17:47:56 routername 36806: Jun 18 17:53:01.088: %SEC-6-IPACCESSLOG: list ingress-filter denied tcp 1.2.3.4(1234) -> 6.7.8.9(53), 4 packets I only really care about the... (12 Replies)
Discussion started by: earnstaf
12 Replies

5. UNIX for Advanced & Expert Users

scripting advice

what is the good way to improve your skill in shell scripting?? (4 Replies)
Discussion started by: memphiz16
4 Replies

6. Shell Programming and Scripting

Script Help/Advice

Alright, I feel like I have a pretty good basic knowledge of shell scripting, but this one is throwing me for a loop. I know I've seen something similar done with awk, but I couldn't find it with the search function. I've grepped through my log file and get results like this: --... (14 Replies)
Discussion started by: earnstaf
14 Replies

7. UNIX for Dummies Questions & Answers

need advice

i am currently running windows vista home premium, i want to install unix because i just started a computer programing course, i am just wondering if i install unix will i still have vista?? how does it work? will i get a choice of which os to run on system startup?? (1 Reply)
Discussion started by: naner9
1 Replies

8. Red Hat

Any advice would help

Hi everyone. I must admit up front that I am not very strong when it comes to Linux. I am actually a Windows guy, but don't let that count against me. :) I work for a very small company so we do not have a Server/Linux Admin on staff. Most of our needs have been handled by our WebHost. We have... (2 Replies)
Discussion started by: liquidstyleb
2 Replies

9. Shell Programming and Scripting

Advice on script

Hi folks, I use following script:- #!/bin/sh # cd Linbread TODAY=`date +"%m%d"` DATA=`grep $TODAY linbread.dat` HOUR=`date +"%H"` if then TOD="Morning" elif then TOD="Afternoon" else TOD="Evening" fi echo $DATA | gawk -F"|" '{printf("%s\n\n%s",$2,$3)}' > $$tmp fold -s -w60... (0 Replies)
Discussion started by: satimis
0 Replies

10. Shell Programming and Scripting

Need Advice

Guys, Can you tell me what value would additional knowledge of PERL and CGI scripting will add to my skill set of UNIX shell scripting and ORACLE PL/SQL? I understand that PERL is a good tool for text processing. (1 Reply)
Discussion started by: yabhi_22
1 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 04:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy