10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
a=1 456
b=4928
c=23
d=456
I want to compare four variables to get the name of the variable having the highest number (2 Replies)
Discussion started by: proactiveaditya
2 Replies
2. Shell Programming and Scripting
Hi, I need to run a Fortran program which reads a input file with a fixed name many times, each time I need to change a number (real) in that input file, this is how I currently do it and I know it is not elegent at all:
cp inputfile.dat backup.dat
sed -i 's/28.0/0.01/g' inputfile.dat
./myCode... (3 Replies)
Discussion started by: dypang
3 Replies
3. Programming
Hello,
I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this :
This is the output of ls command : I stored the output in a file filelist
1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies
4. Shell Programming and Scripting
Currently have this:
set current=192.168.0.5
set servicehost = `echo $current | awk -F. '{print $4}'`
echo $numberoffields
5
..but would like to reduce # of variables and eliminate echo to have something like this:
set servicehost = `awk -v s="$current" -F. 'BEGIN{print $2}'`But... (3 Replies)
Discussion started by: Mid Ocean
3 Replies
5. Shell Programming and Scripting
Hello everyone,
Before I state my problem I would like to inform you that this is not an assignment. I'm just trying to learn some shell programming in my free time.
I'm trying to write a parking fee calculator. But I don't seem to be able to use fractional numbers. Could you please advice... (6 Replies)
Discussion started by: iwant2learn
6 Replies
6. UNIX for Dummies Questions & Answers
##### (0 Replies)
Discussion started by: lucasvs
0 Replies
7. Shell Programming and Scripting
Hi everyone, I am having some problems with my scripts so I hope you could help me.
I am trying to store the result of a division in a variable in tcshell but I have the problem that if:
For example, dividing 2/100 the result is 0.02 but if I store that I have "0".
How can I have 0.02... (8 Replies)
Discussion started by: Bloody
8 Replies
8. Shell Programming and Scripting
Hi Guys,
I'm trying to clean up my home logger file and can't seem to work this out.
Here is my data:
10-19-2009 08:39 00.2 00.0 00.7 01.1 49.1 0.0 11.9 270.1 -49.1 220.9
10-19-2009 08:40 00.2 00.0 00.7 00.7 49.1 0.0 171.9 171.9 49.1 220.9
10-19-2009 08:41 00.1 00.0 00.7 00.8 24.5 0.0... (2 Replies)
Discussion started by: BeJay
2 Replies
9. Shell Programming and Scripting
I've been searching the forums for info on reading a text file in a Cshell script but nothing I'm trying is working. My latest attempt was:
set LASInputFile = `ls *. | head -1`
echo $LASInputFile
while read line
do
echo $line
done < $LASInputFile
My error message is: while:... (7 Replies)
Discussion started by: phudgens
7 Replies
10. Shell Programming and Scripting
Is it possible to process multiple variables in a single sed command?
I have the following ksh with three variables and I want to search for all variables which start with "var" inside input.txt.
I tired "$var$" but it just prints out everyting in input.txt and does not work.
$ more test.ksh... (5 Replies)
Discussion started by: stevefox
5 Replies