[QNX2] pushing stdout to file when command requires extra inputs

Been a while :o

I know I can push the output of a command to a file with the greater-than symbol;

cmd arg1 >/directory/filename

but if that command requires more user input (ie selecting a variable or item number, hitting the enter key, etc), the command just waits idle because it hasn’t received any further input. Is there a certain string that I need to add to tell the system to respond to an anticipated prompt? Is this something I have to make a little script file to run or execute on the command?

Specifically I am trying to save the output of the ddump command because I wanted to see what the bitmap of a partition looked like. I deleted a partition and made it larger, ran dinit, etc etc, but when I run the query command on the partition it still reports the same overall disk size as it was previously formatted even though the mount command reports the new size. Was wondering if a dump of the bitmap on that partition might offer some insight.

[edit] and I’ve been skimming the OS and commands manuals but can’t really see anything that outlines specifically what I am trying to do in this case. I may be dense.

For the first issue: use </dev/null to let your command ignore any input request from the kbd.

The 2nd I don’t get. There is no ddump command in QNX4 at least. Partition change you do with the fully interactive fdisk tool, where you can select the number of cylinders - use type 77, cylinders 0 to max-1, save, set boot if you want, finally reboot with power reset, and AFTER reboot you do the dinit -h.

Hope this helps you on track!

r/ Martin

qnx 2 and 4 are different beasts as far as I have heard across the different posts i’ve read and made here. There’s almost no crossover, if any, for just about anything… coincidentally if you’re suggesting I type </dev/null in the shell after my command, it doesn’t work; I believe a less-than symbol means you’re pointing the command to a file for input.

I’ve become well acquainted with mounting and formatting drives in our systems’ QNX2 environment in the time I have spent maintaining them, this was just a novel situation and I was hoping a dump of the bitmap file/area would offer me some insight.

Yeah my QNX2 experiences are some 30 years passed. Neither I have a machine here what I could activate ^^. Yes, true, there was only file copy crossover using network I remember, not more.

In fact, to change the stdin to /dev/null was the idea to avoid the shell stopping when waiting for user input. This could work, but needs testing of course.

But it could be that the syntax for /dev/null was different, cause one of the main steps in QNX4 was the Posix compatibility while QNX2 was not. Maybe it was “<$null” ?

Check here QNX 2.2 Operating System Reference Guide [1982,1994] for QNX2 docs, there you also find the commands with explanation.

For your origin question, you’ll need to mount the drive of course - I guess with p=2 to use 2nd disk - then use fdisk for sure to adjust the type 7 partition, then give a “dinit N +h ” I think with N being the number where you mounted the drive. I remember we run that commands from floppy drives, prepared the drives, copied operating system on it and then mounted to target machine.

But again, it’s some time ago, so apologizes if I’m talking nonsense. Checking out the QNX2 manual from the above download will help you - crossing fingers!

r/Martin

I’ve got printouts of the manuals and I’ve been poring over them for the past couple days, haven’t found anything that stands out.

And trust me, I’ve got drive formatting and mounting sorted at this point; that’s why I was trying to do a dump of the bitmap file to see if it might offer any insight as to why query and mount were showing two different sizes. I’m not concerned about the drive at this point, I’m slowly converting all of our systems over to 8gb SLC compactflash cards anyway.

I’d just like to figure out how to push the output of a command to a file when the command requires more user inputs.

What’s the exact command sequence you are trying (or have tried) from the command line?

If it’s something like:

ddump 1 1 (dump block 1 of disk 1)

have you tried enclosing in quotes like so:

“ddump 1 1” >/directory/filename

Tim

P.S. I just realized maybe you want the spatch utility:

spatch disk drive block

will give you an interactive screen to look at the block in question on the disk.