10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have the following script, and I want to assign the output ($10 and $5) from awk to N and L:
grdinfo data.grd | awk '{print $10,$5}'| read N L
output from gridinfo data.grd is: data.grd 50 100 41 82 -2796 6944 0.016 0.016 3001 2461. where N and L is suppose to be 3001 and 100. I use... (8 Replies)
Discussion started by: geomarine
8 Replies
2. Shell Programming and Scripting
Hi All,
I need to write one shell script. The requirement is as follows.
a) I am having list the employee names in a file stored in /tmp directory location as below
/tmp/emp.txt
b) and the contents are as below
cat emp.txt
ravi
raj
ram
arun
c) I need to connect to sybase... (1 Reply)
Discussion started by: Gowtham_giri
1 Replies
3. Shell Programming and Scripting
Simple enough problem I think, I just can't seem to get it right.
The below doesn't work as intended, it's just a function defined in a much larger script:
CheckValues() {
for field in \
Group_ID \
Group_Title \
Rule_ID \
Rule_Severity \
... (2 Replies)
Discussion started by: Vryali
2 Replies
4. Shell Programming and Scripting
Hi guys,
I am trying to check the values i have for two variables.
if && ; then
echo "Success";
fi
Now Test1 can have any Alpha Variable and Count is a integer value.
Even though we have given 'and' Condition, even one condition is sucess, i am getting the Success message.
... (11 Replies)
Discussion started by: mac4rfree
11 Replies
5. Shell Programming and Scripting
Hi,
I am trying to do the following thing
var='date'
$var
Above command substitutes date for and in turn runs the date command and i am getting the todays date value.
I am trying to do the same thing as following, but facing some problems,
unique_host_pro="sed -e ' /#/d'... (3 Replies)
Discussion started by: gvinayagam
3 Replies
6. Shell Programming and Scripting
Dear All,
we have a command output which looks like :
Total 200 queues in 30000 Kbytes
and we're going to get "200" and "30000" for further process. currently, i'm using :
numA=echo $OUTPUT | awk '{print $2}'
numB=echo $OUTPUT | awk '{print $5}'
my question is : can I use just one... (4 Replies)
Discussion started by: tiger2000
4 Replies
7. Shell Programming and Scripting
Hi all,
What is the simplest way to setting a variable to $1 if it exists ?
If I go with name=${"$1":-abc}, bash complains "bad substitution",
So I use
name="$1"
name=${name:-abc}
But is there a way to fix this "bad substitution" ?
Thanks! (2 Replies)
Discussion started by: qiulang
2 Replies
8. Shell Programming and Scripting
Hello,
I want to checkl whether my file has text in it or not.
if ; then
...
if ; then
...
But none of these work
Can someone help me?
---------- Post updated at 09:00 AM ---------- Previous update was at 08:55 AM ----------
The code-tags caused an displayerror,... (5 Replies)
Discussion started by: ABE2202
5 Replies
9. UNIX for Dummies Questions & Answers
hi,
pls could you help me with one program in KSH ( i have sunOS).
I need to create an If clause, that prints an error message and filenames, when in a directory are found some files of null size (find . -type f -size 0 ).
thanks (3 Replies)
Discussion started by: palmer18
3 Replies
10. Shell Programming and Scripting
Hi,
I have a comma delimited string, e.g. empno, ename, sal.
Using Korn Shell Script I want to build the SET clause for an UPDATE statement, and set clause should look like this:
empno=decode(:empno, '?', empno, :empno),
ename=decode(:ename, '?', empno, :ename),
sal=decode(:sal, '?',... (14 Replies)
Discussion started by: shalua
14 Replies