10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi Gurus,
Is there a way to call a variable inside a function anywhere within the script?
Thanks.
BR,
Ernesto (2 Replies)
Discussion started by: ernesto
2 Replies
2. Shell Programming and Scripting
Hi guys
I am trying to dereference a variable inside 'egrep -v ' command and getting a 'egrep: syntax error' :
$ echo $exclude_list
ts584d hf584db
for i in `echo $exclude_list`; do
egrep -v ${i} my_file
done
egrep: syntax error
egrep: syntax error
The syntax of the loop is correct.... (1 Reply)
Discussion started by: aoussenko
1 Replies
3. Shell Programming and Scripting
HI,
MY question is a very simple one:
if i want to call an awk script with the input file name and also pass a variable value , then how to do it.
#>awk -f my_script.awk -v variable=value my_inputfile.txt
I can't do it like this.
throws error:
awk: my_script.awk:18:... (0 Replies)
Discussion started by: Onkar Banerjee
0 Replies
4. Shell Programming and Scripting
Hi. I am on a Solaris box and have an awk script which calls perl via the command line:
timeTester="'"`perl -e 'use Time::Local;my $time = timelocal(10,10,10,10,10,2011
);print $time'`"'"
But I want to pass awk variables into this call. These are the example awk variables:
secondField = 10... (0 Replies)
Discussion started by: pedro6994
0 Replies
5. Shell Programming and Scripting
Hello, I was wondering if it were possible to call arguments passed to a script using a variable.
For example:
sh script.sh yes no good bad
x=$#
while
do
echo (last argument, then second last etc until first argument)
let x=($x-1)
done
should print out
bad
good
no (4 Replies)
Discussion started by: VanK
4 Replies
6. Shell Programming and Scripting
I am trying to write a piece of code that will call a value from an array. There are multiple arrays that I need to call data from. Only one array needs to be used based on the step within the program. The arrays have the names "cue_0", "cue_1", and so on.
I can't figure out how to call a value... (2 Replies)
Discussion started by: vockleya
2 Replies
7. Shell Programming and Scripting
Hello.
Looking for a method of modularizing my bash script, I am stuck with such a problem. For example, I have:
MODULE_NAME="test"
FUNCTION_NAME="run"
How do I can a function with name test_run? (4 Replies)
Discussion started by: FractalizeR
4 Replies
8. Programming
I have function declaration in Java and same function definition written in C programming language.. A JNI call from Java is made to a fuction...Function would set the environment variable { putenv(cEnvString1);} using C-built -in function ..and later return the encrypted string...
putenv is... (6 Replies)
Discussion started by: shafi2all
6 Replies
9. Shell Programming and Scripting
#!/bin/sh
APP_ROOT_MODE1=/opt/app1.0
APP_ROOT_MODE2=/opt/app2.0
APP_ROOT=${APP_ROOT_${APP_MODE}}
# enviornment variable APP_MODE will be exported in the terminal where
# we run the applciation, its value is string - MODE1 or MODE2
# My intension is:
# when export APP_MODE=MODE1... (4 Replies)
Discussion started by: princelinux
4 Replies
10. UNIX for Dummies Questions & Answers
I am new to the UNIX environment, but not to programming. My intention is to create a 2D array and print it. Since the Korn Shell does not support that kind of variable, the following is my solution right now.
I have created a group of variables as follows:
table00
table01
table02
table10... (2 Replies)
Discussion started by: morkfard
2 Replies