Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Anyone know?: How the 'for'-loop could stop working in interactive bash shell?! Post 302256005 by alex_5161 on Friday 7th of November 2008 03:02:18 PM
Old 11-07-2008
Anyone know?: How the 'for'-loop could stop working in interactive bash shell?!

It is happening with my sessions already second time: a 'for'-loop for some reason stop to work as expected.
That means or it is looping without exitting, or it is not loop even once.

Here example of my try when it is not processing even one loop.
You can see, I start new subshell and 'for' works fine, but returning back, the 'for' doesn't work again"
Code:
> for ((i=1;i<3;i++));do echo $i; done;
> echo mm
mm
> for ((i=1;i<3;i++));do echo $i; done;
> bash
executing file .bashrc - starting the bash shell--

----> Start of the .myset file  <---

  ----  It is SUN0 box with TEST and MODEL offices  ----

----> End   of the .myset file  <---
>
>
> for ((i=1;i<3;i++));do echo $i; done;
1
2
> 
> exit
exit
> for ((i=1;i<3;i++));do echo $i; done;
> echo boooo
boooo
>
>

Does anybody know what could be a reason?
I do not think it is related to connection soft (I use PuTTY.)

Appreciate any help or hint
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

korn shell to bash - statement not working

Everything else seems to be working, but this isn't. Is it the "cat..." that is wrong of the condition? Thanks. cat tc_result.txt | while read LINE do if then let "files_run += 1"; echo "inside the if loop" # save current filetype case $LINE... (5 Replies)
Discussion started by: brdholman
5 Replies

2. Shell Programming and Scripting

if loop not working in BASH shell

i have this code for a simple if loop: #!/bin/bash array="1 2 3 4 5" array2="5 6 7 8 9" if } -gt ${array} ]; then echo "${array2} is greater than ${array}!!" fi the error is ./script8: line 9: [: too many arguments ./script8: line 9: [: too many arguments ./script8: line 9: [:... (10 Replies)
Discussion started by: npatwardhan
10 Replies

3. Homework & Coursework Questions

Help with Interactive / Non Interactive Shell script

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (1 Reply)
Discussion started by: rits
1 Replies

4. Shell Programming and Scripting

Null Handling in Until loop. . .loop won't stop

Hi Im running this script, which is supposed to find the max value build some tables and then stop running once all the tables are built. Thing is , it keeps assigning a null value to $h and then $g is null so it keep building tables i.e. testupdateNUL. How can I stop this? Here is what I have: ... (4 Replies)
Discussion started by: brandono66
4 Replies

5. Shell Programming and Scripting

Shell Script not working using for loop and a funtion

Hi- Here is the shell script that for some reason is not returning results: #! /bin/ksh - avg() { AVG=0 typeset SUM=0 if then echo "You must have at least two numbers" else for NUM in "$*" do ... (2 Replies)
Discussion started by: koomba
2 Replies

6. Shell Programming and Scripting

export not working in Bash shell

Hi Friends, I am presently migrating shell scripts writter in KSH to SH.I am stuck at this place and i am not able to find a work around:- Let the script name is x.sh Below are some of the codes in it... export abc=hello export abc=hi export abc=how When i am trying to compile the script ... (6 Replies)
Discussion started by: amit.behera
6 Replies

7. AIX

Shell script stop working

I have a strange problem. I have the following in a cron to find files older than a day. find /dir1/dir2/ ! -name . -prune -name "s*.txt" -type f -mtime +1 -exec echo {} \; | wc -w It was working fine for the last few days now it suddenly stopped working. I can clearly see files in the... (5 Replies)
Discussion started by: bbbngowc
5 Replies

8. Shell Programming and Scripting

BASH: Factorial using FOR loop not working

Hi, I am trying to run the factorial script but it’s not working. The code is mentioned below: ------------------------------------------------------------------ /home/gc> cat fact.sh #!/bin/bash # using one command line parameter factorial=1 for (( number = 1; number <= $1 ;... (3 Replies)
Discussion started by: Technext
3 Replies

9. Shell Programming and Scripting

Shell script loop not working

Hi I'm using this script to transcode videos in an Ubuntu 12.04 machine. #! /bin/bash MOVDIR="/media/topaz_1/media/transcodes/transcode_mov/" MOVDESTDIR="/media/topaz_1/media/transcodes/final_mov/" DONEFILESDIR="/media/topaz_1/media/transcodes/dv_cache/"... (1 Reply)
Discussion started by: oscarfelson
1 Replies

10. Shell Programming and Scripting

For loop in bourne shell is not working

I have a loop with cases I am working on Bourne shell for file in *.${Today}*.csv *.${Today}*.txt\ do case ${file} in sun_detail) do something ;; sum) do something ;; mod) do something ;; *) do something ;; (5 Replies)
Discussion started by: digioleg54
5 Replies
SHOREWALL-IPSETS(5)						  [FIXME: manual]					       SHOREWALL-IPSETS(5)

NAME
ipsets - Specifying the name if an ipset in Shorewall6 configuration files SYNOPSIS
+ipsetname +ipsetname[flag,...] +[ipsetname,...] DESCRIPTION
Note: In the above syntax descriptions, the square brackets ("[]") are to be taken literally rather than as meta-characters. In most places where a network address may be entered, an ipset may be substituted. Set names must be prefixed by the character "+", must start with a letter and may be composed of alphanumeric characters, "-" and "_". Whether the set is matched against the packet source or destination is determined by which column the set name appears (SOURCE or DEST). For those set types that specify a tupple, two alternative syntaxes are available: [number] - Indicates that 'src' or 'dst' should repleated number times. Example: myset[2]. [flag,...] where flag is src or dst. Example: myset[src,dst]. In a SOURCE column, the following pairs are equivalent: o +myset[2] and +myset[src,src] In a DEST column, the following paris are equivalent: o +myset[2] and +myset[dst,dst] Beginning with Shorewall 4.4.14, multiple source or destination matches may be specified by enclosing the set names within +[...]. The set names need not be prefixed with '+'. When such a list of sets is specified, matching packets must match all of the listed sets. For information about set lists and exclusion, see shorewall-exclusion[1] (5). EXAMPLES
+myset +myset[src] +myset[2] +[myset1,myset2[dst]] FILES
/etc/shorewall6/accounting /etc/shorewall6/blacklist /etc/shorewall6/hosts -- Note: Multiple matches enclosed in +[...] may not be used in this file. /etc/shorewall6/maclist -- Note: Multiple matches enclosed in +[...] may not be used in this file. /etc/shorewall6/rules /etc/shorewall6/secmarks /etc/shorewall6/tcrules SEE ALSO
shorewall6(8), shorewall6-actions(5), shorewall6-blacklist(5), shorewall6-hosts(5), shorewall6-interfaces(5), shorewall6-maclist(5), shoewall6-netmap(5),shorewall6-params(5), shorewall6-policy(5), shorewall6-providers(5), shorewall6-rtrules(5), shorewall6-routestopped(5), shorewall6-rules(5), shorewall6.conf(5), shorewall6-secmarks(5), shorewall6-tcclasses(5), shorewall6-tcdevices(5), shorewall6-tcrules(5), shorewall6-tos(5), shorewall6-tunnels(5), shorewall6-zones(5) NOTES
1. shorewall-exclusion http://www.shorewall.net/manpages6/shorewall-exclusion.html [FIXME: source] 06/28/2012 SHOREWALL-IPSETS(5)
All times are GMT -4. The time now is 09:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy