Increase two numeric variables incrementally together
Hi, I was wondering if someone could help with what is probably a fairly easy problem. I have two variables, i is between 1-5, j is between 11-15
I'd like to produce this:
Each number goes up incrementally with the other.
But my shoddy code is not playing ball:
And is producing:
As you can see, this is not what I what I had intended
This is a small scale example - in reality i is between 1000-6000 and j is between 7000-12000 and I am creating files with this template "$i"_"$j".txt
Using this code, I am getting thousands of unwanted files. I just want $i to increase with $j, rather than every possible combination of $i and $j.
Any help using shell (rather than python/perl) scripting would be very much appreciated.
Not sure if you want to do anything else with j in your actual code, but in every case j is i+10 or (i+6000 in your full example), so you could just use:
This User Gave Thanks to Chubler_XL For This Post:
Hi, thanks that's also a great idea. There are instances where I could simply add on 6000, but others where I can't, so both yours and bipinajith's solutions should cover what I need. Thanks!
Example
I have following requirements where i need to search for particular string from the log files.Files will be archived with number attached end to it and creates a new log file.
First Day i will ran at 8:00 AM
Filename:a.log1
Wed Aug 24 04:46:34... (1 Reply)
Please, i have a question about rsync command:
Here is the command that i have used in my script:
rsync -ratlz --rsh="/usr/bin/sshpass ssh -o StrictHostKeyChecking=no" -aAXHltzh --progress --numeric-ids --devices --rsync-path="rsync" $1 $hostname:$1
using this command, i can... (0 Replies)
Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is:
1702938475,SNU022,201004
the first 10 numbers always begin with 170 (6 Replies)
Hello everybody,
I am having problem in converting byte array variables to Hexa String variables for Linux. I have done, converting byte array variables to Hexa String variables for Windows but same function doesn't work for linux. Is there any difference in OS ? The code for Windows is given... (2 Replies)
Hey, dunno if the title really explains this well; basically my problem is (and this is on a router which is why the flash issue)...
I have some data I want to store (it's really irelevant, i'm just counting the lines per file, basically a simple counter).
I could store this data in flash but... (0 Replies)
Hi
I need to get a user to enter a number (an exchange rate) into a script. I have the following:
#!/bin/ksh
echo "Enter exchange rate:"
read EX_RATE
if \"`" ]
then
echo "Well done - only numeric here"
else
echo "Not so well done - there is NON numeric stuff here!"
fi
This works... (3 Replies)
I've refined the filesystem size using awk and directed to a file name.
eg, here's the content in a file called "numbers"
$cat numbers
345
543
23423456
44435
546
.
.
how do you write a script to all these numbers to get the total?
thanks a lot. (9 Replies)