07-01-2005
Simply shell script question
Struggling to add numbers in shell script..
ie.
a=3
b=4
c=$a + $b
echo $c
I thought this should give me 7 - but cannot see what wrong.. should be simple answer eh?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a file say xmldir.conf. This is a flat file which contains the data in specific format not other then this. The format is
/backup/surjya/mvfile,noeof
/backup/surjya/mdbase,eof
/backup/surjya/mdbaseso
/backup/surjya/trial,hoeof
/backup/surjya/test,eof
The field before "," is... (2 Replies)
Discussion started by: surjyap
2 Replies
2. Shell Programming and Scripting
I am using ksh.
There is a report having amounts in the following format,
34343.67-
2343.45
23434.89-
I want to sum up all the amounts. For this I first need to find out if there is a minus sign at the end and prefix it before summing up. How to achieve this?
I thought of using an... (2 Replies)
Discussion started by: tselvanin
2 Replies
3. UNIX for Dummies Questions & Answers
Suppose I have a script named "sc.sh"
in the script how to print out its name "sc.sh"? (3 Replies)
Discussion started by: meili100
3 Replies
4. Shell Programming and Scripting
HI, i would like to ask you several question regarding a shell ( #!/bin/sh)
i need to make a program that able to do :
1.Accept the name of a logle as the sole command line argument
2.search the specied logle for lines that have been added since the previous search.
3. construct an e-mail... (1 Reply)
Discussion started by: grandios
1 Replies
5. Programming
when i run a shell script i have to type
./my_prog
and the first line of my_prog has to have
#!/usr/bin/env bash
how do i change it to i only have to type my_prog to run it? (4 Replies)
Discussion started by: omega666
4 Replies
6. Homework & Coursework Questions
hiiiiiiiiiiiii,,I found an error on my following script but couldnt find it!!! Can you please help me as soon as possible?!
echo "enter a number "
read n
i=0
first=0
second=1
result=0
prime="true"
echo –n " $first $second "
while
do
result=`expr $first + $second`
first=$second... (10 Replies)
Discussion started by: moonlips
10 Replies
7. Shell Programming and Scripting
Suppose another person wrote the following one-line shell script:
echo $RANDOM > /dev/tty
QUESTION #1: How can the random number, which is output to the terminal by this script, be captured in a variable?
QUESTION #2: How can this be done in a cron job?
Specific code, whether in ksh or... (1 Reply)
Discussion started by: Paul R
1 Replies
8. Shell Programming and Scripting
daily few files will be available in one directories /azure/file and it should be moved to other directories /azure/file/recent directories if I run my script.
azure/files> ll *7847*
N7847.TXTFILE
N7847.DMNFILE
Once the script is triggered the above file should be moved to the... (3 Replies)
Discussion started by: ramkumar15
3 Replies
9. Shell Programming and Scripting
I am getting error files missing. can anyone tell me I can able to read the file. Can you tell what the other part does? xargs -i test -f {}
cat $S.file | uniq | xargs -i test -f {} || error_func "files(s) missing!" (4 Replies)
Discussion started by: ramkumar15
4 Replies
10. Shell Programming and Scripting
I am not sure which is the better way for the below shell script.
I need to find the below process running and sent it to the desired user.
please let me know which is most feasible right way.
ps -ef | grep "Server" > /shome/kk/text.txt
cat /shome/kk/text.txt| mail -s "Email... (5 Replies)
Discussion started by: ramkumar15
5 Replies