Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it.
To make a long story short around 20K pieces of... (2 Replies)
Hi all
Sorry for the basic question, but i am writing a shell script to get around a slightly flaky binary that ships with one of our servers. This particular utility randomly generates the correct information and could work first time or may work on the 12th or 100th attempt etc !.... (4 Replies)
Please help me to automatically assign the output of awk command to the variables cs3, cs4, cs5 and cs6 using a for loop. The below code is not working.
for i in 3 4 5 6
do
cs$i=`awk -F"|" 'BEGIN{sum=0}{sum=sum+$'$i'}END{printf("%d\n", sum)}' css`
done
echo $cs3 $cs4 $cs5 $cs6 (9 Replies)
I am new to unix and trying to make a script for writing all my command into another file and use that file to run all commands
I am trying to use for loop with echo command to generate a command based script for writing the file with all the command sequentially w.r.t for loop.
I want... (6 Replies)
Hi,
I have the following folder structure:
TST500-1000
TST500-2000
TST500-3000
TST700-1000
TST700-2000
TST700-3000
TST900-1000
TST900-2000
TST900-3000
I would like to store the numbers in the first column (considering "-" as column separator) into a variable then the numbers in... (3 Replies)
I'm relatively new to bash scripting and am trying to use awk inside a bash for loop but am having a problem with the variables.
for i in $(seq 30 5 60)
do
# Define variables up and down in AWK
eval $(awk 'BEGIN{ print "up=$((i+1))"}' < /dev/null)
eval $(awk 'BEGIN{ print... (2 Replies)
I'm taking a unix class and need to countdown to 0 from whatever number the user inputs. I know how to do this with a while or until loop but using the for loop is throwing me off....
I know I can use an if-then statement in my for loop but can I include a while loop in my for loop? (3 Replies)
Hi there guys!
I was trying to do:
while read line; do
if ; then
read -p "Press Enter to continue..."
cont=0
fi
echo $line
let cont++
done < file.txt
However, I have read that the read -p would not work in a while loop...
I was wondering if there is any other way to... (2 Replies)
I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
I am trying to check whether particular host and port are responding or not. I am using below script to check. but node_port array that i am using in loop is getting replaced with previous iteration value. Script and output is given.
Please help me to understanding why node_port values are... (5 Replies)
Discussion started by: tmalik79
5 Replies
LEARN ABOUT NETBSD
seq
SEQ(1) BSD General Commands Manual SEQ(1)NAME
seq -- print sequences of numbers
SYNOPSIS
seq [-w] [-f format] [-s string] [-t string] [first [incr]] last
DESCRIPTION
The seq utility prints a sequence of numbers, one per line (default), from first (default 1), to near last as possible, in increments of incr
(default 1). When first is larger than last the default incr is -1.
All numbers are interpreted as floating point.
Normally integer values are printed as decimal integers.
The seq utility accepts the following options:
-f format Use a printf(3) style format to print each number. Only the A, a, E, e, F, f, G, g, and % conversion characters are valid,
along with any optional flags and an optional numeric mimimum field width or precision. The format can contain character
escape sequences in backslash notation as defined in ANSI X3.159-1989 (``ANSI C89''). The default is %g.
-s string Use string to separate numbers. The string can contain character escape sequences in backslash notation as defined in ANSI
X3.159-1989 (``ANSI C89''). The default is
.
-t string Use string to terminate sequence of numbers. The string can contain character escape sequences in backslash notation as
defined in ANSI X3.159-1989 (``ANSI C89''). This option is useful when the default separator does not contain a
.
-w Equalize the widths of all numbers by padding with zeros as necessary. This option has no effect with the -f option. If any
sequence numbers will be printed in exponential notation, the default conversion is changed to %e.
The seq utility exits 0 on success and non-zero if an error occurs.
EXAMPLES
# seq 1 3
1
2
3
# seq 3 1
3
2
1
# seq -w 0 .05 .1
0.00
0.05
0.10
SEE ALSO jot(1), printf(1), printf(3)HISTORY
The seq command first appeared in Plan 9 from Bell Labs. A seq command appeared in NetBSD 3.0. This command was based on the command of the
same name in Plan 9 from Bell Labs and the GNU core utilities. The GNU seq command first appeared in the 1.13 shell utilities release.
BUGS
The -w option does not handle the transition from pure floating point to exponent representation very well. The seq command is not bug for
bug compatible with the Plan 9 from Bell Labs or GNU versions of seq.
BSD May 27, 2010 BSD