Sponsored Content
Top Forums Shell Programming and Scripting bash and ksh: variable lost in loop in bash? Post 302228826 by estienne on Monday 25th of August 2008 02:09:07 PM
Old 08-25-2008
Thanks a lot. I was afraid of that. I should have tested it more before posting. Grrrrrrrrr... I don't like this behavior of bash!

Thx.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash & Ksh loop problem

hi i was trying to optimize one script and i came across this problem .. i am putting some pseudo code here $ >cat a.sh ls | while read I do i=$(($i + 1)) done echo "total no of files : " $ >ksh a.sh total no of files : $ >bash a.sh total no of files : why is... (1 Reply)
Discussion started by: zedex
1 Replies

2. Shell Programming and Scripting

Emulate ksh's FPATH variable in bash

Over time i have developed a library of useful (ksh) functions which i use in most of my scripts. I use the ksh's FPATH variable to locate all these functions and use a standard environment-setting-function to always have the same environment in all my scripts. Here is how i begin scripts: ... (3 Replies)
Discussion started by: bakunin
3 Replies

3. Shell Programming and Scripting

(BASH) Using a loop variable to grep something in a file?

Hi, I have a loop running until a variable L that is read previously in the full script. I'd like to grep some information in an input file at a line that contains the value of the loop parameter $i. I've tried to use grep, but the problem is nothing is written in the FILE files. It seems grep... (5 Replies)
Discussion started by: DMini
5 Replies

4. UNIX for Dummies Questions & Answers

Help with 3 variable bash loop

Hi all! I think someone might be able to solve my problem pretty easily. I am trying to run a bash loop with 3 variables. I know how to do: for var1 in `cat list1`; do for var2 in `cat list2`; do for var3 in `cat list3`; command var1 var2 > var3; done; done; done However, this will run all... (4 Replies)
Discussion started by: torchij
4 Replies

5. Programming

Global variable in for loop (BASH)

Hello, I'm trying to read the variable "pause" from a for loop without luck. The function is dependant on the outcome of the test within the loop. If i run this, pause is always 0 within the function. Any ideas? Thanks. pause=0 users=1 (for (( ; ; )) do speed=`cat speed.log` ... (7 Replies)
Discussion started by: shadyuk
7 Replies

6. Shell Programming and Scripting

Bash for loop with arrays second variable?

I am fairly new to bash and am not sure how to resolve this: I have a series of geographical long/lat points eg. 50/-30 listed on separate lines in a file called junk2. I have input these into an array and am then using that array in a for loop. Towards the end of the loop I create a file called... (4 Replies)
Discussion started by: lily-anne
4 Replies

7. Shell Programming and Scripting

Variable scop ksh vs bash

I am not clear why the cnt variable is not increased in the script below: #!/bin/bash INPF=${1:-a.txt}; KWDS=${2:-lst} cnt=0; grep -v '^#' $KWDS | while read kwd; do grep -q $kwd $INPF; if ; then echo Found; ((cnt=cnt+1)); fi... (5 Replies)
Discussion started by: migurus
5 Replies

8. Shell Programming and Scripting

Bash variable available for use outside loop

In the below for loop, I extract a variable $d which is an id that will change each time. The bash executes the problem that I am having is that p (after the done) is the path with the extracted $d. However, I can not use it in subsequent loops as it is not reconized. I have been trying to change... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. UNIX for Beginners Questions & Answers

How do I assign the output of a command to a variable within a loop in bash?

In the else of the main if condition . else set lnk = $(readlink -f <path> | cut -d '/' -f7) echo "$lnk" if ] When I run the above on command line , the execution seems to be fine and I get the desired output. But when I try to assign it to a variable within a loop... (12 Replies)
Discussion started by: sankasu
12 Replies

10. UNIX for Beginners Questions & Answers

Bash Variable scope - while loop while reading from a file

Cope sample1: test.sh i=0 echo " Outside loop i = $i " while do i=$(( $i + 1)) echo "Inside loop i = $i " done echo " Out of loop i is : $i " When run output : Outside loop i = 0 Inside loop i = 1 Inside loop i = 2 Inside loop i = 3 Inside loop i = 4 Inside loop i = 5 Inside... (8 Replies)
Discussion started by: Adarshreddy01
8 Replies
UGENSA(4)						   BSD Kernel Interfaces Manual 						 UGENSA(4)

NAME
ugensa -- USB generic serial adapter SYNOPSIS
ugensa* at uhub? ucom* at ugensa? HARDWARE
The ugensa driver supports the following adapters (or their USB device portion, for adaptors that contain a USB host controller, hub and a USB device): Airprime PC5220 Novatel FlexPak GPS receiver Qualcom CDMA MSM (found in Kyocera KPC650 EVDO interface) Qualcom Inc. CDMA AC8700 (found in the ZTE 1x EVDO interface) Sierra AirCard 580 Sierra AirCard 595 Sierra AirCard 875 [not tested] Sierra Wireless EM5625 [not tested] Sierra Wireless MC5720 [not tested] Sierra Wireless MC5725 [not tested] Sierra Wireless MC8755 [not tested] Sierra Wireless MC8755 [not tested] Sierra Wireless MC8755 [not tested] Sierra Wireless MC8765 [not tested] Sierra Wireless MC8775 [not tested] Novatel Wireless Merlin CDMA (found in Verizon V620) [not tested] Novatel ExpressCard [not tested] Novatel Wireless S720 [not tested] Novatel Ovation U720 [not tested] Novatel Merlin XU870 HSDPA ExpressCard [not tested] Novatel Merlin ES620 [not tested] Dell/Novatel Wireless HDSPA modem Dell W5500 HDSPA modem [not tested] AnyDATA ADU-E500A [not tested] DESCRIPTION
The ugensa driver provides support for the USB-to-RS-232 Bridge chip used by various vendors. The device is accessed through the ucom(4) driver which makes it behave like a tty(4). SEE ALSO
tty(4), ucom(4), usb(4) HISTORY
The ugensa driver first appeared in NetBSD 3.0. BSD
December 14, 2009 BSD
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy