10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how can i optimize the following:
TOTALRESULT="total1=4
total2=9
total3=89
TMEMORY=1999"
TOTAL1=$(echo "${TOTALRESULT}" | egrep "total1=" | awk -F"=" '{print $NF}')
TOTAL2=$(echo "${TOTALRESULT}" | egrep "total2=" | awk -F"=" '{print $NF}')
TOTAL3=$(echo... (4 Replies)
Discussion started by: SkySmart
4 Replies
2. 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
3. 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
4. Shell Programming and Scripting
Heyas
Me try to print only the value of a (specific) variable assignment from a file.
What i get (1):
:) tui $ bin/tui-conf-get ~/.tui_rc TUI_THEME
dot-blue
""
"$TUI_DIR_INSTALL_ROOT/usr"
"$TUI_DIR_INSTALL_ROOT/etc/tui"
"$TUI_PREFIX/share/doc/tui"
"$TUI_PREFIX/share/tui"... (2 Replies)
Discussion started by: sea
2 Replies
5. Shell Programming and Scripting
Hi,
Was hoping someone could help with the following:
while read line; do pntadm -P $line | awk '{if (( $2 == 00 && $1 != 00 ) || ( $2 == 04 )) print $3,$5}'; done < /tmp/subnet_list
Anyone know if it is possible to assign $3 and $5 to separate variables within the {} brackets?
Thanks... (14 Replies)
Discussion started by: CiCa
14 Replies
6. Shell Programming and Scripting
So, in awk, I've always put my variable assignments inside of the curly braces, just like dad, and grandpa, and the 26 generations before them. But today I came upon an awk statement that had them outside the braces-- blasphemy!
Seriously, though, is there any practical difference? I was... (3 Replies)
Discussion started by: treesloth
3 Replies
7. Shell Programming and Scripting
Hi There,
I am writing a ksh script which assigns variable values from file "A" and passes that variables to file "B". While passing the parameters an additional "$" sign is being assigned to awk -v option.
Could any one help me with this please.
#!/bin/ksh
head -1... (3 Replies)
Discussion started by: Jeevanm
3 Replies
8. 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
9. Shell Programming and Scripting
Hi All,
I have a little awk script which uses a variable (x):
awk -v x=0 'NF != 6 { ++x } END { print "This batch had " x " errors out of ", NR" records"}'
But when I've tried to put the command in a file I can't seem to declare the variable. I've managed to simplify the code so that I... (4 Replies)
Discussion started by: pondlife
4 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