From: Janis Papanagnou on 11 Aug 2010 11:36 On 11/08/10 17:04, srikanth wrote: > On Aug 11, 8:55 am, Barry Margolin <bar...(a)alum.mit.edu> wrote: >> In article >> <9a7c7480-8de2-4c39-9da9-15fd9b111...(a)i19g2000pro.googlegroups.com>, >> srikanth <srikanth0...(a)gmail.com> wrote: >>> On Aug 10, 10:30 pm, pk <p...(a)pk.invalid> wrote: >>>> On Tue, 10 Aug 2010 08:06:47 -0700 (PDT) srikanth <srikanth0...(a)gmail.com> >>>> wrote: >> >>>>> Hi All, >>>>> Just wanted to know if we can generate data with given input size with >>>>> the help of shell script. Any idea from our group? [...] >>> I Just want to generate files with data. Any type of data that doesn't >>> depend upon the content what it is.. >>> How can we do this with the help of awk or perl? >> >> If you use /dev/random in the above command, you'll get the specified >> amount of random bytes. >> > > It should contain human readable data not he system readable data. If > i use dd if=/dev/random it is generation some system level data which > we can't read. Certainly it is human readable if you pipe it, e.g., through od(1). Janis
From: John Kelly on 11 Aug 2010 11:46 On Wed, 11 Aug 2010 17:36:56 +0200, Janis Papanagnou <janis_papanagnou(a)hotmail.com> wrote: >On 11/08/10 17:04, srikanth wrote: >> On Aug 11, 8:55 am, Barry Margolin <bar...(a)alum.mit.edu> wrote: >>> In article >>> <9a7c7480-8de2-4c39-9da9-15fd9b111...(a)i19g2000pro.googlegroups.com>, >>> srikanth <srikanth0...(a)gmail.com> wrote: >>>> On Aug 10, 10:30 pm, pk <p...(a)pk.invalid> wrote: >>>>> On Tue, 10 Aug 2010 08:06:47 -0700 (PDT) srikanth <srikanth0...(a)gmail.com> >>>>> wrote: >>> >>>>>> Hi All, >>>>>> Just wanted to know if we can generate data with given input size with >>>>>> the help of shell script. Any idea from our group? >[...] >>>> I Just want to generate files with data. Any type of data that doesn't >>>> depend upon the content what it is.. >>>> How can we do this with the help of awk or perl? >>> >>> If you use /dev/random in the above command, you'll get the specified >>> amount of random bytes. >>> >> >> It should contain human readable data not he system readable data. If >> i use dd if=/dev/random it is generation some system level data which >> we can't read. > >Certainly it is human readable if you pipe it, e.g., through od(1). /dev/urandom is better than /dev/random for junk data. Or maybe even /dev/zero piped to hexdump. You can use a format with hexdump to eliminate spaces in the output. I did not see a way to do that with od. -- Web mail, POP3, and SMTP http://www.beewyz.com/freeaccounts.php
From: John Kelly on 11 Aug 2010 11:51 On Wed, 11 Aug 2010 15:46:35 +0000, John Kelly <jak(a)isp2dial.com> wrote: >/dev/urandom is better than /dev/random for junk data. Or maybe even >/dev/zero piped to hexdump. You can use a format with hexdump to >eliminate spaces in the output. I did not see a way to do that with od. Whoops. hexdump can read /dev/zero directly, no pipe needed: hj:~# hexdump -n 4 -v -e '/1 "%.2x"' /dev/zero 00000000 Just change the "-n 4" to the number of bytes you want. -- Web mail, POP3, and SMTP http://www.beewyz.com/freeaccounts.php
From: Janis Papanagnou on 11 Aug 2010 11:59 On 11/08/10 17:46, John Kelly wrote: > On Wed, 11 Aug 2010 17:36:56 +0200, Janis Papanagnou > <janis_papanagnou(a)hotmail.com> wrote: > >> On 11/08/10 17:04, srikanth wrote: >>> On Aug 11, 8:55 am, Barry Margolin <bar...(a)alum.mit.edu> wrote: >>>> In article >>>> <9a7c7480-8de2-4c39-9da9-15fd9b111...(a)i19g2000pro.googlegroups.com>, >>>> srikanth <srikanth0...(a)gmail.com> wrote: >>>>> On Aug 10, 10:30 pm, pk <p...(a)pk.invalid> wrote: >>>>>> On Tue, 10 Aug 2010 08:06:47 -0700 (PDT) srikanth <srikanth0...(a)gmail.com> >>>>>> wrote: >>>> >>>>>>> Hi All, >>>>>>> Just wanted to know if we can generate data with given input size with >>>>>>> the help of shell script. Any idea from our group? >> [...] >>>>> I Just want to generate files with data. Any type of data that doesn't >>>>> depend upon the content what it is.. >>>>> How can we do this with the help of awk or perl? >>>> >>>> If you use /dev/random in the above command, you'll get the specified >>>> amount of random bytes. >>>> >>> >>> It should contain human readable data not he system readable data. If >>> i use dd if=/dev/random it is generation some system level data which >>> we can't read. >> >> Certainly it is human readable if you pipe it, e.g., through od(1). > > /dev/urandom is better than /dev/random for junk data. Or maybe even > /dev/zero piped to hexdump. You can use a format with hexdump to > eliminate spaces in the output. I did not see a way to do that with od. > > > With od you can specify someting like -t x1 or whatever desired as format. Postprocessing to remove the address or eliminate the blanks is trivial. I wonder, though, why you suggest /dev/zero. If the data is irrelevant you can as well use something like yes "The same line..." | head -100 yes "0" | tr -d $'\n' | head -1000 yes "0000000000" | tr -d $'\n' | head -100 Janis
From: Janis Papanagnou on 11 Aug 2010 12:02 On 11/08/10 17:51, John Kelly wrote: > On Wed, 11 Aug 2010 15:46:35 +0000, John Kelly <jak(a)isp2dial.com> wrote: > >> /dev/urandom is better than /dev/random for junk data. Or maybe even >> /dev/zero piped to hexdump. You can use a format with hexdump to >> eliminate spaces in the output. I did not see a way to do that with od. > > Whoops. hexdump can read /dev/zero directly, no pipe needed: > > hj:~# hexdump -n 4 -v -e '/1 "%.2x"' /dev/zero > 00000000 > > Just change the "-n 4" to the number of bytes you want. Okay. Then I'd use a shell builtin... printf "%0*d", 78, 0 ....will print 78 zeroes. Janis
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: #!/bin/sh 2>&1 |tee -a /tmp/logfile Next: removing files |