04-11-2019
Also to add to Don's reply...
Just an observation.
Do we take it that the leading 5 digits only and NOT the whole filenames themselves determine the positional play.
if so what will happen if two or more end up with an identical 5 digit number from your random number generator?
If you have 9999 music files then this is a possibility...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have a filename called XYZ12345.txt.I just want to eliminate numeric and have only XYZ.txt.
How can i do it ?
Regards,
Sona. (8 Replies)
Discussion started by: Sona
8 Replies
2. Shell Programming and Scripting
i have several thousand files and in subdirs that are named
file.46634.txt
budget.75346.pdf
etc
i want to remove the number but retain the extension.
it is always a 5 digit.
thanks. (6 Replies)
Discussion started by: jason7
6 Replies
3. Shell Programming and Scripting
Hi All,
Can you please help me.
The situation is like this. There are many different file name in this directory.
I have to grep all the file that the name start with "PTWO" and rename it to COM with the current date.
This is the script that I have done and it hit an... (16 Replies)
Discussion started by: badbunny9316
16 Replies
4. UNIX for Dummies Questions & Answers
Hi, I am pretty new to this.
I have a condition where in I want to replace all files within a folder. All filenames with character "abc" would need to replaced with "xyz".
eg:
helloabcworld-->helloxyzworld
helloworld-->helloworld
...
...
Thanks in advance. (6 Replies)
Discussion started by: sakets_2000
6 Replies
5. Shell Programming and Scripting
In the Directory all the Files are following format.
Filename_yyyymmdd_numbers.txt
eg.
file_name_20120106_015802.txt .
I want to write the Shell script to rename all the file to
file_name.txt.in the directory.
Thanks
Mani (5 Replies)
Discussion started by: gavemani
5 Replies
6. UNIX for Dummies Questions & Answers
dear all,
i have .dat files named as:
34.dat
2.dat
16.dat
107.dat
i would like to sort them by their filenames as:
2.dat
16.dat
34.dat
107.dat
i have tried numerous combinations of sort and ls command (in vain) to obtain :
107.dat
16.dat
2.dat
34.dat (1 Reply)
Discussion started by: chen.xiao.po
1 Replies
7. UNIX for Advanced & Expert Users
Hi all
Thanks in advance...........
Please help me for this issue............
I have a file it has 11 records . I used the command like ....
>$ wc -l file
11 file
I'm getting output like 11 file (no.of records along with filename)
here my requirement is, I want to display only... (3 Replies)
Discussion started by: ksrivani
3 Replies
8. UNIX for Dummies Questions & Answers
i have a file called 'test.txt' which contains the below data.
abc123
123445
123abc
23224q
From the above data, i want to display the line which contains only numeric . So i have tried the below commands with sed
sed -n '/^$/p' test.txt
sed '/^$/!d' test.txt
But it... (4 Replies)
Discussion started by: pandeesh
4 Replies
9. Shell Programming and Scripting
Hi,
I have a list of log files as follows:
name_date_0001_ID0.log
name_date_0001_ID2.log
name_date_0001_ID1.log
name_date_0002_ID2.log
name_date_0004_ID0.log
name_date_0005_ID0.log
name_date_0021_ID0.log
name_date_0025_ID0.log
.......................................... (4 Replies)
Discussion started by: alex2005
4 Replies
10. Shell Programming and Scripting
I am using awk to sum up all amounts and at end print total.
input:
10,250.00
20,103.15
expected output:
30353.15
code:
{subtot=+$1} END{print subtot}
The problem I encounter is it stops at commas and returns 30 as answer
And if I use this code:
{subtot=($1+0);subtot=+$1}... (9 Replies)
Discussion started by: paresh n doshi
9 Replies
LEARN ABOUT OPENSOLARIS
rand
rand(3UCB) SunOS/BSD Compatibility Library Functions rand(3UCB)
NAME
rand, srand - simple random number generator
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
int rand();
int srand(seed)
unsigned seed;
DESCRIPTION
rand() uses a multiplicative congruential random number generator with period 2^32 to return successive pseudo-random numbers in the range
from 0 to 2^31 -1.
srand() can be called at any time to reset the random-number generator to a random starting point. The generator is initially seeded with a
value of 1.
SEE ALSO
cc(1B), drand48(3C), rand(3C), random(3C)
NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system
libraries or in multi-thread applications is unsupported.
The spectral properties of rand() leave a great deal to be desired. drand48(3C) and random(3C) provide much better, though more elaborate,
random-number generators.
The low bits of the numbers generated are not very random; use the middle bits. In particular the lowest bit alternates between 0 and 1.
SunOS 5.11 30 Oct 2007 rand(3UCB)