10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I stumbled upon a problem, which I simplified to this:
There is a list of numbers, stored in variable $LIST, lets use `seq 5 25` for demonstration.
There is a number that should be compared against this list. For demonstration I use user input - read VALUE
I am trying to compare RegEx... (2 Replies)
Discussion started by: Zorbeg
2 Replies
2. Shell Programming and Scripting
Hello,
Can I ask how to expand variable that contains another in bash? I need to loop variable within another one like this:
RD1=testgrp
RD2=testgroup
RD3=testgroupfile
RD4=tstgroup
...
RD40=try2013
DEST=/home/king/finaldir
for i in {1..40}; do
mv ${RD${i}} ${DEST}
done
I do not... (8 Replies)
Discussion started by: yifangt
8 Replies
3. Shell Programming and Scripting
#aa=xxxx
#zz="cc $aa"
#aa=gggg
#echo $zz
out put is
cc xxxx
if I want to get
cc gggg
how should I do, I don't want to write zz="c $aa " after aa=gggg (2 Replies)
Discussion started by: yanglei_fage
2 Replies
4. Shell Programming and Scripting
$ p="1 2 5 8"
$ set -- $p
$ echo $3
5
$ k=3
$ echo \$${k}
$3
I want the "echo \$${k}" to get the output 5 , how to modify ? (6 Replies)
Discussion started by: yanglei_fage
6 Replies
5. Shell Programming and Scripting
Hello,
I am struggling with using variable made using "eval".
a=4
eval b$a=20
echo $b$a ???
As shown above, I am trying to call back the variable "bX" assuming I do not know the value of "a".
How can I do that?
I tried several combinations but nothing worked.
Thanks (10 Replies)
Discussion started by: jolecanard
10 Replies
6. Shell Programming and Scripting
Hello,
I would like to define a variable based on another variable:
a=5
b$a=100
This does not work. What is the right way to do it?
Thanks
---------- Post updated at 07:37 PM ---------- Previous update was at 07:33 PM ----------
Found my answer with the search function (did not... (0 Replies)
Discussion started by: jolecanard
0 Replies
7. Shell Programming and Scripting
Hello all,
I'm working on a script, and as part of it, I'm trying to create a loop that will run through a stored piece of information a certain number of times pulling out information, and each time create a variable with a unique name that will store that information. I'm sure it's a simple... (3 Replies)
Discussion started by: DeCoTwc
3 Replies
8. Shell Programming and Scripting
Just started BASH scripting, and I tried to make a script 'args' to display all of the arguments that I give to it.
#!/bin/bash
if
then
echo "No arguments specified."
fi
val=
for ((i=1; i <= $# ; i++))
do
eval "\$val=\$$i"
echo "Argument number $i is $var."
done
However... (3 Replies)
Discussion started by: test_test
3 Replies
9. Shell Programming and Scripting
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)
Discussion started by: estienne
2 Replies
10. Shell Programming and Scripting
Hi All,
I need to pass a variable to perl script from bash script, where in perl i am using if condition. Here is the cmd what i am using in perl
FROM_DATE="06/05/2008"
TO_DATE="07/05/2008"
"perl -ne ' print if ( $_ >="$FROM_DATE" && $_ <= "$TO_DATE" ) ' filename"
filename has... (10 Replies)
Discussion started by: arsidh
10 Replies