Sponsored Content
Top Forums Shell Programming and Scripting Variable value inconsistency on BASH and CSH Post 302305277 by quirkasaurus on Wednesday 8th of April 2009 11:30:54 AM
Old 04-08-2009
no offense, but i've been working on solaris for 20 years. it works fine.

your logic and implementation of this problem is a little obscure.

to me, it looks like your output ~should~ be this:

123a123b123c

since it looks like you're appending data AND input each time.

the problem may be that using the HERE document creates a subshell,
wherein variable changes are not exported.

So. I think a better sample of your input data and expected output would
be in order and really help us to find a solution.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

From bash to csh and zsh

... Am I glad to find this forum (and vBulletin too, nice!).. OK, here's my issue. I have been handballed a bash script, not pretty but functional. I need to change to csh and zsh. For the csh I have the basics (e.g., such as change if/fi to if/endif, quote the variables, and bracket commands).... (10 Replies)
Discussion started by: lev_lafayette
10 Replies

2. Shell Programming and Scripting

different shell csh bash

I'm always having to work in the cshell, but occasionally want to run a command using bash. is that possible? I know I could write a shell script and call bash at the begining with #!/usr/bin/bash and then my command, is there another way? (1 Reply)
Discussion started by: ajp7701
1 Replies

3. Shell Programming and Scripting

how to make your bash script run on a machine with csh and bash

hi, i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies

4. Shell Programming and Scripting

Bash one liner to CSH

Hello all, I have a Bash command I'm using on one system that replaces text in filenames, I'ts not working on another system that uses the Csh shell. Can anyone tell me what I need to do when i run for f in *;do mv $f ${f/text1/text2};done on the CSH shell i get ""Missing }."" (7 Replies)
Discussion started by: mike171562
7 Replies

5. UNIX for Dummies Questions & Answers

Running CSh scripts in Bash

Hi, I have some csh scripts and I want to run them in .bashrc. I use these techniques without any success: . test.csh or csh test.csh The first one assumed that the scripts is a bash script, so showed me errors. The second one finished without giving proper result. Can anybody offer... (6 Replies)
Discussion started by: mjdousti
6 Replies

6. Shell Programming and Scripting

Importing env from csh to bash

Hi All, In my account with csh shell, there are lots of env variables set and I want to import those all to bash in one stroke, is there any way to do it ? Thanks, D (1 Reply)
Discussion started by: Deei
1 Replies

7. Shell Programming and Scripting

Need a script to convert csh to bash

Hi, Can anyone give me a script to convert csh to bash? or any key points which can help me to do so as i am new to it. (3 Replies)
Discussion started by: vineet.dhingra
3 Replies

8. Shell Programming and Scripting

How to access the bash variables in csh

Hi, I am having a primary script which is Bash based. I am calling a csh script from it. Now, their are some variables defined in my bash script which i need in csh. I am unable to do so. Is it possible ? (2 Replies)
Discussion started by: vdhingra123
2 Replies

9. Ubuntu

error LD: undefined variable while changing shell from bash to csh

Hi, i am a beginner in ubuntu. my default shell is bash. everytime i try to change the shell with command "csh", i get a message (probably an error message). after i get into c-shell, when i try to execute a c shellscript, then it showed the same message. any idea about what is this about or any... (1 Reply)
Discussion started by: Avinash Nayak
1 Replies

10. Shell Programming and Scripting

Changing script from csh to bash

Hello Guys I have a script working fine on csh, but I would like to change it to bash, how I should change this command to be able to work as bash script. :wall: if ( $fsw > "0" ) then foreach swath ( `awk 'BEGIN {for (i='$fsw';i<='$lsw';i++) printf ("%s\n", i) }'` ) ## work to be done... (2 Replies)
Discussion started by: jiam912
2 Replies
SLALSD(l)								 )								 SLALSD(l)

NAME
SLALSD - use the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS SYNOPSIS
SUBROUTINE SLALSD( UPLO, SMLSIZ, N, NRHS, D, E, B, LDB, RCOND, RANK, WORK, IWORK, INFO ) CHARACTER UPLO INTEGER INFO, LDB, N, NRHS, RANK, SMLSIZ REAL RCOND INTEGER IWORK( * ) REAL B( LDB, * ), D( * ), E( * ), WORK( * ) PURPOSE
SLALSD uses the singular value decomposition of A to solve the least squares problem of finding X to minimize the Euclidean norm of each column of A*X-B, where A is N-by-N upper bidiagonal, and X and B are N-by-NRHS. The solution X overwrites B. The singular values of A smaller than RCOND times the largest singular value are treated as zero in solving the least squares problem; in this case a minimum norm solution is returned. The actual singular values are returned in D in ascending order. This code makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray XMP, Cray YMP, Cray C 90, or Cray 2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. ARGUMENTS
UPLO (input) CHARACTER*1 = 'U': D and E define an upper bidiagonal matrix. = 'L': D and E define a lower bidiagonal matrix. SMLSIZ (input) INTEGER The maximum size of the subproblems at the bottom of the computation tree. N (input) INTEGER The dimension of the bidiagonal matrix. N >= 0. NRHS (input) INTEGER The number of columns of B. NRHS must be at least 1. D (input/output) REAL array, dimension (N) On entry D contains the main diagonal of the bidiagonal matrix. On exit, if INFO = 0, D contains its singular values. E (input) REAL array, dimension (N-1) Contains the super-diagonal entries of the bidiagonal matrix. On exit, E has been destroyed. B (input/output) REAL array, dimension (LDB,NRHS) On input, B contains the right hand sides of the least squares problem. On output, B contains the solution X. LDB (input) INTEGER The leading dimension of B in the calling subprogram. LDB must be at least max(1,N). RCOND (input) REAL The singular values of A less than or equal to RCOND times the largest singular value are treated as zero in solving the least squares problem. If RCOND is negative, machine precision is used instead. For example, if diag(S)*X=B were the least squares prob- lem, where diag(S) is a diagonal matrix of singular values, the solution would be X(i) = B(i) / S(i) if S(i) is greater than RCOND*max(S), and X(i) = 0 if S(i) is less than or equal to RCOND*max(S). RANK (output) INTEGER The number of singular values of A greater than RCOND times the largest singular value. WORK (workspace) REAL array, dimension at least (9*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2), where NLVL = max(0, INT(log_2 (N/(SMLSIZ+1))) + 1). IWORK (workspace) INTEGER array, dimension at least (3*N*NLVL + 11*N) INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. > 0: The algorithm failed to compute an singular value while working on the submatrix lying in rows and columns INFO/(N+1) through MOD(INFO,N+1). FURTHER DETAILS
Based on contributions by Ming Gu and Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA Osni Marques, LBNL/NERSC, USA LAPACK version 3.0 15 June 2000 SLALSD(l)
All times are GMT -4. The time now is 02:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy