9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
so i found a way to do this.
#!/bin/bash
MYF=$(/home/jason/myfunctions)
source <(printf '%s\n' "${MYF}")
echo "${var1}"
/home/jason/myfunctions is a script that outputs information..i.e. functions...etc that needs to be sourced. I have no control over /home/jason/myfunctions. i can... (3 Replies)
Discussion started by: SkySmart
3 Replies
2. Shell Programming and Scripting
Hi Everybody :)
I need your help, because i know a local variable in a function for example k, it is different of other variable(with the same name k) this a global variable. Is that right?
dgawk> run
Starting program:
3238860128818202
3 4 7 11 12 13 17 22 23 32 35 37 41 48 49 55 63 ... (5 Replies)
Discussion started by: solaris21
5 Replies
3. Shell Programming and Scripting
I have a question on how can I assign a output of a function to a variable which is executed in background.
Here is my example
$ cat sample_program.sh
#!/bin/ksh
exec_func () {
sleep 1
v=`expr $1 + 100`
print $v
}
export OUT_ARR
date
for i in 1 2
do
OUT_ARR=`exec_func $i` &... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
4. Shell Programming and Scripting
Hi,
gtkdialog gui seperate buttons use seperate functions in their GUI. A variable (newFolderName) is being set in one function (funcA) and it needs to be called in another function (funcB). I thought using global variable (like in python) concept should work however it does not.
... (4 Replies)
Discussion started by: singhai.nish
4 Replies
5. UNIX for Dummies Questions & Answers
Hello All,
How do i overwrite a sourced script variable value.
Sourced Script:
GEN_PARAM_LIST4=""$LOG_DIR"/dwh_GenerateXMLFile.lst"
GEN_PARAM_LIST4_v2=""$LOG_DIR"/dwh_GenerateXMLFile.v2.lst"
I am using below statement for replacing.
Script2:
&&... (1 Reply)
Discussion started by: Ariean
1 Replies
6. Shell Programming and Scripting
I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line
if
then... (8 Replies)
Discussion started by: saku
8 Replies
7. Shell Programming and Scripting
Hi,
I construct a bash script to finish some tasks. One of the task is to set up some environment variables. There is already one script file to complete the environment variables setting work. I am not able to know the detail of how to set these variables. So, I may just need to call this... (4 Replies)
Discussion started by: gofortime
4 Replies
8. UNIX for Dummies Questions & Answers
Hey I have a question....
what is the difference between using == vs -eq when testing in WHILE loops.
I use the following test that only worked with == signs....
if
why do i need == and not -eq?
2. I need to re-use some code in a couple places in this script. is functions my best... (5 Replies)
Discussion started by: danieldcc
5 Replies
9. Shell Programming and Scripting
Hi
my shell is tcsh
can I have functions in my shell scripting?
Is the below shell script correct.
Can I have two functions and call one of them as required.
----------
echo "functions"
f1
f1 ()
{ echo "hello" }
f2 () (1 Reply)
Discussion started by: amitrajvarma
1 Replies