Sponsored Content
Top Forums Shell Programming and Scripting reading external variables does not work Post 302340469 by ABE2202 on Monday 3rd of August 2009 12:46:54 PM
Old 08-03-2009
reading external variables does not work

Code:
 
...
declare vINIFILE
vINIFILE=$1
...
echo "The name of the File is $vINIFILE" >>mail_tmp
echo "" >> mail_tmp.$$
...
grep RUNJOB=0 $vINIFILE >>tmp_filter
...

So the strange is in echo-statement I get the correct output for $vINIFILE wrtitten into the file mail_tmp. But the grep-statement does not work, tmp_filter is empty, though $vINIFILE has for sure the string RUNJOB=0

I tried everything, replaced

Code:
 
grep RUNJOB=0 $vINIFILE >>tmp_filter
grep RUNJOB=0 "$vINIFILE" >>tmp_filter
grep RUNJOB=0 ${vINIFILE} >>tmp_filter

but none of these worked. When I tried to run the statement hardcoded, meaning replaced $vINIFILE by the filename, then it worked.

Can someone help me?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

reading variables from a file

Hi, Could anyone help me in understanding what I am missing.. I have a text file with the following info. INFILE=> #Name Variable=<value> #--------------------------------- name1 inargs="-a Filename1.$VAR.csv -f Filename2.$VAR.csv -c File.c" name1 ... (4 Replies)
Discussion started by: ttshell
4 Replies

2. Shell Programming and Scripting

How to parse config variables from external file to shell script

How do i use a config.txt to recursively pass a set of variables to a shell script eg my config.txt looks like this : path=c://dataset/set1 v1= a.bin v2= b.bin path=c://dataset/set2 v1= xy.bin v2= abc.bin .................. and so on . and my testscript : (2 Replies)
Discussion started by: pradsh
2 Replies

3. Shell Programming and Scripting

awk - arithemetic functions with external variables

I'm trying to get awk to do arithmetic functions with external variables and I'm getting an error that I cannot figure out how to fix. Insight would be appreciated money=$1 rate1=$(awk -F"\t " '/'$converting'/{print $3}' convert.table) rate2=$(awk -F"\t"... (2 Replies)
Discussion started by: DKNUCKLES
2 Replies

4. Shell Programming and Scripting

Substituting variables from external files

Hi All, I have the following problem: 1. I have a file containing a line: a,b,d,${d},e,f 2. From within a script I grep the file for '^a,' to get the line 3. I obtain the fourth field as follows: Field4="$( print -r $fileEntry | cut -d, -f4 )" 4. The script exports variables at the... (1 Reply)
Discussion started by: oneillc9
1 Replies

5. Filesystems, Disks and Memory

external USb hard disk reading problem

Hello, I am facing a hard disk drive reading problem since last one month and not able to resolve it. The thing is I purchased external USB hard disk (seagate 40 gb) 2 years back.And uptil now its working perfectly fine. But suddenly one day I am not able to read my data. The problem goes like... (1 Reply)
Discussion started by: albertspade
1 Replies

6. Shell Programming and Scripting

cd command doesn't work through variables

Hi.... cd command is not working when dual string drive/volume name is passed to cd through variables....... For Ex.... y=/Volumes/Backup\ vipin/ cd $y the above command gives error....... anyone with a genuine solution ? (16 Replies)
Discussion started by: vipinchauhan222
16 Replies

7. Shell Programming and Scripting

Help with reading and assigning variables

Hi Gurus, I have a file named log with 2 lines Each line is a file name. eg $ cat log monday tuesday I need to read log and assign each output(filename) to a different variable. The following doesn't work:- while read A B do echo " a is ${A} " echo " b is ${B} " done <... (6 Replies)
Discussion started by: wisdom
6 Replies

8. Shell Programming and Scripting

Reading file from remote system and work on it locally

Hi! I am still fairly new to shell programming, but I have taken an interest to it and want to try some new stuff. I intend to make a shell script (using bash) to read a file on a remote system, then do some work on it on the local system and display it. In the long run I want to have a... (9 Replies)
Discussion started by: aaOzymandias
9 Replies

9. Shell Programming and Scripting

Assign value to external variables from awk

Hello I have a text file with the next pattern Name,Year,Grade1,Grade2,Grade3 Name,Year,Grade1,Grade2,Grade3 Name,Year,Grade1,Grade2,Grade3 I want to assign to external variables the grades using the awk method. After i read the file line by line in order to get the grades i use this ... (2 Replies)
Discussion started by: Spleshmen
2 Replies

10. Shell Programming and Scripting

Reading variables from a file

Hi, I have an issue that hope someone will be able to help me with.... I'm using a while-read loop to read lines from a file that contain variables, and I want the variables substituted, but I can't get it to work - the below example with explain: while read line do echo $line ... (5 Replies)
Discussion started by: AndyG
5 Replies
XmScrollVisible(library call)											     XmScrollVisible(library call)

NAME
XmScrollVisible -- A ScrolledWindow function that makes an invisible descendant of a ScrolledWindow work area visible SYNOPSIS
#include <Xm/ScrolledW.h> void XmScrollVisible( Widget scrollw_widget, Widget widget, Dimension left_right_margin, Dimension top_bottom_margin); DESCRIPTION
XmScrollVisible makes an obscured or partially obscured widget or gadget descendant of a ScrolledWindow work area visible. The function re- positions the work area and sets the specified margins between the widget and the nearest viewport boundary. The widget's location relative to the viewport determines whether one or both of the margins must be adjusted. This function requires that the XmNscrollingPolicy of the ScrolledWindow widget be set to XmAUTOMATIC. scrollw_widget Specifies the ID of the ScrolledWindow widget whose work area window contains an obscured descendant. widget Specifies the ID of the widget to be made visible. left_right_margin Specifies the margin to establish between the left or right edge of the widget and the associated edge of the viewport. This margin is established only if the widget must be moved horizontally to make it visible. top_bottom_margin Specifies the margin to establish between the top or bottom edge of the widget and the associated edge of the viewport. This margin is established only if the widget must be moved vertically to make it visible. For a complete definition of ScrolledWindow and its associated resources, see XmScrolledWindow(3) RELATED
XmScrolledWindow(3). XmScrollVisible(library call)
All times are GMT -4. The time now is 11:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy