10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am facing a problem.
export local_folder=/opt/app/
cd /opt/app/abc/
abcversion="abc*" (abcga5 is inside /opt/app/abc/)
echo $abcversion (it echoes the correct version as abcga5 )
Now when I reuse the value of abcversion for a below path:
export... (6 Replies)
Discussion started by: ankur328
6 Replies
2. Shell Programming and Scripting
Hi
I have a strange problem:
In my shell script I am performing a copy task:
. prop.txt
cp -r $dir/ $dir/archive
$dir is fetched from a property file (prop.txt) which stores its value
dir=/opt/data
Now the problem is another dir1 comes into picture. I only want to add... (1 Reply)
Discussion started by: ankur328
1 Replies
3. Shell Programming and Scripting
guys,
i would like to know what does the below does.
tr=`echo $bfile | cut -d"." -f4`
tr=${tr#TR}
i tried with assigning a value and executed second line. but after that also value of tr remains same.
thanks in advance .. (1 Reply)
Discussion started by: expert
1 Replies
4. Shell Programming and Scripting
Hi,
In AIX I have a variable with , (coma) separated values assigned to it like shown below
var1=apple,boy,chris
i want to convert this to
var1='apple','boy','chris'
the number of values assigned to var1 might change and it could be from 1 to n
any suggestions please? (3 Replies)
Discussion started by: rahul9909
3 Replies
5. Shell Programming and Scripting
I try to run this script, however, it gives an exception in line 3. How do I do an assignment to a substituted variable?
#!/bin/bash
name=fruit
ext_$(eval echo ${name})=apple
tmp=ext_$(eval echo ${name})
if ]; then
echo "apple"
elif ]; then
echo "orange"
fi
echo ${!tmp}
Error... (2 Replies)
Discussion started by: angelokh
2 Replies
6. Linux
Hi,
I've got a small problem.
If varible A stores "B" and Variable B stores C,
How to get the value of variable B by using only Variable A..?
I tried the following but didnt work pease help..
$ var1=vikram
$ echo $var1
vikram
$ vikram=sampath
$ echo $vikram
sampath
$ echo... (6 Replies)
Discussion started by: vickramshetty
6 Replies
7. Shell Programming and Scripting
The construct ${#parameter} returns the number of characters in the parameter and ${!parameter} specifies an indirect variable. My question is: How do I combine these two. What I want is ${#!parameter} but this gives an error.
Of course I can use:
dummy=${!parameter}
${#dummy}
but that's a... (0 Replies)
Discussion started by: gone_bush
0 Replies
8. Shell Programming and Scripting
Hi,
I'm writing a KSH script, and at one point, I have to call a new shell and perform some variable assignments.
I noticed that the assignment is not working.
Please see two samples below:
Command 1:
#>ksh "i=2;echo I is $i"
Output:
#>I is
Command 2:
#>ksh <<EOF
> i=2
> echo I... (7 Replies)
Discussion started by: maverick80
7 Replies
9. UNIX for Advanced & Expert Users
Using bash, I'm trying to read a .properties file (name=value pairs), assigning an indirect variable reference for each line in the file.
The trick is that a property's value string may contain the name of a property that occurred earlier in the file, and I want the name of the 1st property to... (5 Replies)
Discussion started by: tkrussel
5 Replies
10. UNIX for Dummies Questions & Answers
Hello Everybody,
Does anyone know what the @ symbol means in a csh script, if used with a variable assignment as below
@ line = 1
why not just use....
set line=1
Many thanks
rkap (1 Reply)
Discussion started by: rkap
1 Replies