What is the format of the config file? Why do you have to change it?
The config file was mostly intended to be used with a vb script. I didn't really want to start maintaining two separate config files, as I actually do use the vb script as well.
The config file holds variables in the form of ...
variable = "value"
Quote:
Originally Posted by cfajohnson
Why are you using declare? It's not necessary.
I'm using declare because if I don't bash will try to use $var_name as a command. Using declare I can create variables by using variables. This way I can just add variables to the config file if needed and I don't need to go back to the script and manually declare each one separately on it's own line.
Quote:
Originally Posted by cfajohnson
It is odd. Why do it?
Because they would throw my script off as the script takes some action based on the contents of the variables. I would have to account for the variable values having quotations around them which they shouldn't have in the first place.
Quote:
Originally Posted by cfajohnson
What do you think it does?
Well, running 'help declare' at the shell gives me ...
Quote:
declare: declare [-afFirtx] [-p] [name[=value] ...]
Declare variables and/or give them attributes. If no NAMEs are
given, then display the values of variables instead. The -p option
will display the attributes and values of each NAME.
I assumed (yeah,yeah...bad idea to make assumptions ) that it would be like declaring a variable normally only with this the declaration is explicit and you can define its type (dunno exactly what practical use that would give?).
However, after I wrote this I wrote a test that simply does...
So I'm guessing the issue ultimately lies in the way I'm getting the variable values, which seems to allude to a pipeline "issue" (not really an issue, just the way bash handles it) that I read in this thread.
However, I just got around my problem by doing the following ...
So all in all, it works now. It's a bit of a kluge, but oh well.
using bash Tru64...
converting DCL to shell...
any tips to make this work would be greatly appreciated.
Below is my failed attempt to assign command line input to variables by first declaring an array. I use a counter to create unique variables in a loop through the array. I need to call... (3 Replies)
Dear all
I declare like this in my program :
int main(int argc ,char **argv)
{
FILE *ft;
char* ini_file;
char fbuf;
char sendbuf;
char strbuf;
}
When I compile
this is the error :
cc: "send.c", line 28: error 1588: "ft" undefined. (1 Reply)
Hi,
I use AIX (ksh) and Linux (bash) servers. I'm trying to do scripts to will run in both ksh and bash, and most of the time it works. But this time I don't get it in bash (I'm more familar in ksh).
The goal of my script if to read a "config file" (like "ini" file), and make various report.... (2 Replies)
I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends.
As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Hello all,
I am trying to "make" a database system, VDB (Veritas Data Base), and when I run "make" I receive the following error:
VDBException.h:19: error: expected `)' before '*' token
VDBException.h:20: error: expected `)' before '*' token
VDBException.h:43: error: expected `)' before '*'... (4 Replies)
Hello,
I have a script that runs a series of commands. Halfway through the script, I want it to check whether everything is going alright: if it is, to proceed with the script, if it isn't to repeat the last step until it gets it right.
My code so far looks like this, simplified a bit:
... (3 Replies)
This is a short program I wrote to search through a directory and move files containing the keyword to a folder.
#!/bin/bash
echo 'What is the directory?'
read DIR
echo -e '\n'
echo 'What is the keyword?'
read KEY
echo -e '\n'
cd $DIR
rmdir 'relevant_files'
mkdir 'relevant_files'... (5 Replies)
Hi,
In the code "for loop" has been used to search for files (command line arguments) in directories and then produce the result to the standard output. However, I want when no files are named on the command line, it should read a list of files from standard input and it should use the command... (7 Replies)
If I am running a bash command, and some awk getting the ethernet adapter on the local machine. It works fine. But if I will run it from the remote, it is EMPTY on echo and throwing error in grep.
Thank you
This work perfectly fine
$ f=`/sbin/ip a|grep 127.127 | awk '{print $NF }' ` ; ip... (2 Replies)