Search Results

Search: Posts Made By: astropi
6,268
Posted By astropi
Thank you, that works! One slight problem...
Thank you, that works!
One slight problem however. When I run the code from the parent directory, and say: (edited to be more specific)


#!/bin/ksh

cd /path/
if [ ! -f file ]; then
echo...
6,268
Posted By astropi
how to check to see if a file exists?
I want to write a script to see if various files exist. What I want to do is have the script search in various directories if a file exist, and if not, then output something like "/path/file does not...
1,655
Posted By astropi
It's actually quite long, so it would not be a...
It's actually quite long, so it would not be a good idea to post all of it. The first two values are here:

0.002077
0.038983

All values are give to this precision. So clearly in this case both...
1,655
Posted By astropi
Yes, I did get it to work using awk. As noted,...
Yes, I did get it to work using awk.
As noted, if someone can tell me why Ygor's code did not work, I would like to know. Thanks for everyone's help!
1,655
Posted By astropi
Thanks, it looks like it should work, but...
Thanks, it looks like it should work, but unfortunately nawk does not work, since I get:

-bash: nawk: command not found

... so, if possible it would be great to get the code Ygor started on...
1,655
Posted By astropi
Thanks Ygor, that *almost* works! The problem I...
Thanks Ygor, that *almost* works!
The problem I get is that for some reason no values are written to OK.txt
Also, for each line that is run, I get an error similar to this:

./num.sh[26]:...
1,655
Posted By astropi
Quick Question concerning Reading and Writing
First off, this is not homework nor for any class.

I have a file (column) of data such as:

12.56
2.78
0.54
22.7
... etc.

(call the file "num") I want to read in each line, then check to...
2,310
Posted By astropi
Yup, that was it. Obviously I'm just a beginner...
Yup, that was it. Obviously I'm just a beginner here! A couple of questions if you have the time.

1)What's the difference between bash and ksh and is one better than the other?

2)if [ "$(echo...
2,310
Posted By astropi
On line 29 I have: read a b < temp_star1 ...
On line 29 I have:

read a b < temp_star1

I have a lot of comments before that, and a few simple shell commands that should not affect anything. I just noticed I am using

#!/bin/bash
...
2,310
Posted By astropi
I'm not sure what the above expression does, but...
I'm not sure what the above expression does, but it did work for the case when a < b, however when a > b I get:

line 29: [: : integer expression expected

always some issue isn't there :)
2,310
Posted By astropi
Thanks for the quick reply! Very helpful. Quick...
Thanks for the quick reply!
Very helpful. Quick follow-up question. I don't know if this matters, but my values are not necessarily integers, and I got this warning:

line 21: [: 5.039814: integer...
2,310
Posted By astropi
simple(?) if/else question
Hello, I have a quick question that is not related to homework in any way shape or form (in case anyone wanted to know). My question is thus:

I have a file "temp" that has the two values say "5"...
1,772
Posted By astropi
Corona, thank you very much! That's very useful :)
Corona, thank you very much! That's very useful :)
1,772
Posted By astropi
Much thanks! :b:
Much thanks!
:b:
1,772
Posted By astropi
"Simple" echo/reading variable question...
Hello, I have a simple(I think) question!
Although simple, I have been unable to resolve it, so I hope someone can help! OK, here it is:

1)I have an awk script that prints something, such as:...
Showing results 1 to 15 of 15

 
All times are GMT -4. The time now is 04:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy