I have 2 files namely file1 and file2.
in file1 I have something like this
I have to write this date to file2 as
I hope one can easily understand what I am doing. Its all coping values and replacing previous values.
Note: files will have other entities. So echo kind of commands will not work for me.
Thanks & Regards,
linuxUser_
For the data shown in red, do you want your script to perform the arithmetic calculations shown in the comments, or do you want the comments to be part of the output with the numeric values shown replaced with data from your input file?
If your script is supposed to perform the calculations:
How is your script supposed to determine the value of $level0?
Is double precision floating point arithmetic sufficient for these calculations, or do you need arbitrary precision calculations rounded to six digits of precision after the decimal point?
Does case matter when printing your variable names? (Your input has uppercase X, Y, and Z; your output uses lowercase x, y, and z.)
Can the output lines be reordered such that xg is printed with xMin and xMax, yg is printed with yMin and yMax, and zg is printed with zMin and zMax instead of grouping all of the *g variables at the end of the output?
What shell do you use? (Or more importantly, does your system have a 1993 or later version of the Korn shell? Floating point arithmetic is built-in in ksh93, but not in any other shells I use.)
This User Gave Thanks to Don Cragun For This Post:
I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server..
I have seen some code that may help - but I cant get it working as below:
spawn /usr/bin/ksh
send "telnet x <port_no>\r"
expect "Enter command: "
send "LOGIN:x:x;... (2 Replies)
Hi ,
I am having one situation in which I need to run some simple unix commands after doing "chroot" command in a shell script. Which in turn creates a new shell.
So scenario is that
- I need to have one shell script which is ran as a part of crontab
- in this shell script I need to do a... (2 Replies)
I am writing a tool that connects using SSH to a remote server and perform some actions (through root)
However - I would like to hide my operations so they will be hard to track.
I tried STRACE on the SSHD process and saw all the traffic going there so I am quite transparent to STRACE
... (1 Reply)
I am doing this simple script using c shell and korn shell. The commands I use are fgrep , ls, and also some redirecting. Is there any difference in using both of these commands in c shell and korn shell? Thanks and sorry for the stupid question. (1 Reply)
Hey,
I have two seperate files with a column og data about item 277 and 289 in each. Fx:
277
-1.34534
-0.98272
0.12293
etc
and
289
-4.58493
9.88273
9.33829
etc.
How do i get the second input for item 277 (i.e. -.098272) and add or subtract it from the similar second input from... (2 Replies)
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Hi,
I am working on HP-AUX Unix machine.
I need to find a file whether it has been updated in 15 minutes.
Please help me with the command.
I am using Ksh (1 Reply)
hi!i want to print all registered users(theres a difference for registered users and logged users right?we can print logged users using who command but registered?) in the system,the groups and my current running processes(with the command ps -ef , ok i can get all the running processes in the... (13 Replies)
basically i'm tired of hitting the left arrow a few dozen times when correcting a mistake or modifying a history command
i'd like to use vim style key shortcuts while on the command line so that a 55 moves the cursor 55 places to the left...
and i want all the other vi goodies, search of... (3 Replies)
Hi Guys,
I am busy trying to re-write a shell script that was written way back.
I need help with these codes:
# Process switches
if ; then
echo "usage : process <optional instance>"
exit 99
fi
What does the above code mean?
What does these $? -gt 1 mean?
Then I have... (3 Replies)