All Questions
3 questions
4
votes
1
answer
173
views
Strange behavior of `unset` for local variables
I can't explain the following behavior of unset:
#!/bin/bash
my_unset() { unset "$@"; }
fn1() { local var; unset var; var=1; }
fn2() { local var; my_unset var; var=2; }
var=0
fn1; ...
0
votes
1
answer
784
views
Passing local variable to remote shell bash script
Trying to pass local variable to remote shell using bash script. Here is what I am trying. This is test.sh
#!/bin/bash
envi=$1
function samplefunction {
echo "Environment ...
0
votes
3
answers
135
views
bash execute variable (with command that held variable which is created inside if statement )
Hi i have script as below:
mode= loop1 or loop2
command1="screen -dm -S $name feh *.jpg"
if [ "$(screen -S loop1 -X select . ; echo $?)" != 0 ] && [[ $mode != "loop1" ]];then
name="loop1"
...