10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a script whose contents are as below
result= awk 's=100 END {print s }'
echo "The result is" $result
The desired output is
The result is 100
My script is running without exiting and i am also not getting the desired output.
Please help (5 Replies)
Discussion started by: bk_12345
5 Replies
2. Shell Programming and Scripting
my script is some thing like this
i11="{1,2,3,4,5,6,7,8,9,10,11,}"
echo "enter value"
read value ..............suppose i11
x="$value"
echo "$($value)" .............the echo should be {1,2,3,4,5,6,7,8,9,10,11,}
but its showing "i11" only.
plz help me out to get desired... (10 Replies)
Discussion started by: sagar_1986
10 Replies
3. Shell Programming and Scripting
I am trying to assign a value to a variable thru awk and I am having a lot of problem with it. Pls see the code snippet. The one in RED is the actual code. Other lines are the op created by the system. As you can see from the data, I was expecting an output of DG010 SDS FILE for FILE_NAME... (6 Replies)
Discussion started by: vskr72
6 Replies
4. Shell Programming and Scripting
HI,
This is the code I am using:
awk -v aaa="connect" 'BEGIN {IGNORECASE} /aaa/,/!/ {print NR}' bb
This does not throw any error but it does not work. Pls help
Thanks. (4 Replies)
Discussion started by: sudvishw
4 Replies
5. UNIX for Advanced & Expert Users
echo "hello123" | tr -dc '' | wc -c
using this command i can count the no of times a number from 0-9 occurs in the string "hello123"
but how do i save this result inside a variable?
if i do
x= echo "hello123" | tr -dc '' | wc -c
that does not work...plz suggest..thanks (3 Replies)
Discussion started by: arindamlive
3 Replies
6. Shell Programming and Scripting
suppose in my script i have written
a1=2
a2=4
read option
# I directly want to see the value of a1 or a2 (i:e; 1 or2 )depending upon i/p given like a1 or a2 to option var.so what should i give .Suppose if I give a1 to option then how can I see the value.
echo $$option --- doesn't work
pls... (3 Replies)
Discussion started by: maitree
3 Replies
7. Shell Programming and Scripting
Hi,
The following command runs on in the Korn shell prompt. however i want to output the value of this to a variable. Can anyone provide a solution?
echo 'ABC,DEF,"G,HI,J",KLM,"MNi,O"'| awk -F "\"" '{for(i=1;i<=NF;i++){if(i%2)gsub("\,","~^~",$i)}}1' (2 Replies)
Discussion started by: ladarlsan
2 Replies
8. Shell Programming and Scripting
Hi All,
I am getting the output for the following command when i run it on the unix console.
---------------------------
grep `whoami` /etc/passwd | awk '{print ($1);}' | cut -d ":" -f3
----------------------------
But i made it into a script and tried to print the variable, its... (5 Replies)
Discussion started by: meheretoknow
5 Replies
9. Shell Programming and Scripting
Date of Request: 20080514 10:37 Submitted By: JPCHIANG
i want to get the value "JPCHIANG" only in read a file, however, when i do this:
name=`"$line"|cut -d " " -f8`
it display all the line and append 'not found' at the end of the statement
the $line is actually a variable in a... (2 Replies)
Discussion started by: finalight
2 Replies
10. UNIX for Dummies Questions & Answers
Here is my code
let x=10 #or any other calculated value done here
`echo $sol | awk '{print substr($0,1,(x-3))}'`
Question.
I am able to use the variable x in beginning at character "1"
but I get nothing when using it for the next n characters.
Should I be able to... (1 Reply)
Discussion started by: smacleod
1 Replies