Hello,
On Thu, 18 Jun 2020, Dale wrote:
>David Haller wrote:
[..]
>> Compile with:
>> gcc $CFLAGS -o ones ones.c
>> or
>> gcc $(portageq envvar CFLAGS) -o ones ones.c
>>
>> and use/test e.g. like
>>
>> ./ones | dd of=/dev/null bs=8M count=1000 iflag=fullblock
[..]
>I got it to compile, at least it created a file named ones anyway. What
>I'm unclear about, where is the if= for dd in the command? All the
>commands I've seen before has a if= and a of=. The if for input and of
>for output or target.
==== man 1 dd ====
if=FILE
read from FILE instead of stdin
[..]
of=FILE
write to FILE instead of stdout
====
note the stuff after 'instead' ;)
>I'm assuming that if I want to target sdb, I'd
>replace null with /dev/sdb.
Yes.
>As I've posted before, even my scripting skills are minimal. Surprised
>I got it to compile even.
Well, you could copy & paste and on gentoo, there is bound to be a
'gcc' ;)
>something. I placed all this in the /root directory. I'm assuming I
>can copy paste the commands above while in /root to make it work?
Yes. Or put 'ones' in /root/bin/ or even /usr/local/bin. Depending on
if you expect to use the program later on. But if it's just for this
once it's fine in /root/ alongside the sourcecode.
HTH,
-dnh
--
BUGS
It is not yet possible to change operating system by writ
ing to /proc/sys/kernel/ostype. -- Linux sysctl(2) manpage