Email: bknpk@hotmail.com Phone: +972-54-7649119
V

 

ASIC/FPGA Design and Verification Out Source Services

simple bash script, which demonstrates a generation of random number within a specified range

  1. The scripts generates a random number within a user specified range.
  2. The random number, in this example, is used to find a file and touch it.
  3. The script is shown below:


  4. #!/bin/bash

    rnd_max="32767"
    num_file=`find my_web -name "*.html" | wc -l`
    #generate a random number within range
    idx_file=$(($num_file * $RANDOM))
    idx_file=$(($idx_file / $rnd_max))
    cnt="0"
    for f in $(find my_web -name "*.html"); do
      if [ "$cnt" -eq "$idx_file" ] ; then
        cmd="touch "$f
        echo $cmd
        eval $cmd
      fi
      cnt=$[$cnt+1] #increment
    done




Please let me know what you think on my site.

 


Contact me now at:

  ...


I would be happy to offer my services. Call ASAP !


Home

This page demonstrates the usage of queues in C++ and discusses some motivation to implement it.






Search This Site


Feedback This Site




new pages on this site