Search Results

Search: Posts Made By: AxlVanDamme
2,206
Posted By Corona688
Depends. What's your shell? $(((RANDOM%100)+1))...
Depends. What's your shell? $(((RANDOM%100)+1)) should work instead of ${RANDOM} for bash or ksh.
2,206
Posted By Corona688
# Clear the list of commandline parameters set...
# Clear the list of commandline parameters
set --

for X in 1 2
do
# Add a random number to the end of the parameter list
set -- "$@" "${RANDOM}"
done

echo "First number was...
3,676
Posted By balajesuri
The highlighted line above may be shortened as...
The highlighted line above may be shortened as for i in {1..10}.
3,676
Posted By chihung
#!/usr/bin/ksh echo "Enter 10 numbers" for...
#!/usr/bin/ksh

echo "Enter 10 numbers"
for i in 1 2 3 4 5 6 7 8 9 10
do
read a
echo $a
done > numbers
2,214
Posted By agama
They'd be in a file. The script, or the awk,...
They'd be in a file. The script, or the awk, read's the file, sums the numbers and presents the average. The 'input-file' or 'input-file-name' in the samples would be the name of your file that...
Showing results 1 to 5 of 5

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