Did I messed up something by accidentally pasting the ‘/etc/inittab’ into the shell

hp-ux

Help me Unix specialists,

We were doing some system checkup and I entered into the shell (ussing PuTTY):
# more /etc/inittab.
I copied the contents of the output with intentions to paste all that into a document.
But then accidentally I hit the right click, and in putty that means PASTE so i pasted all that back into the shell.

Did i messed up something really bad? I am afraid that the system won't boot next time? Im going crazy it's a production system. So far everything seems normal. The /etc/inittab is still the same, but I am afraid that I might have messed up something else that will reveal itself later.

# more /etc/inittab
init:3:initdefault:
ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
tape::sysinit:/sbin/mtinit > /dev/console 2>&1
muxi::sysinit:/sbin/dasetup   </dev/console >/dev/console 2>&1 # mux init
stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar </dev/systty
brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck, etc.
link::wait:/sbin/sh -c "/sbin/rm -f /dev/syscon;                        /sbin/ln /dev/systty /dev/syscon" >/dev/console
2>&1
cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon           # legal req
sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1           # system init
#powf::powerwait:/sbin/powerfail >/dev/console 2>&1            # powerfail
cons:123456:respawn:/usr/sbin/getty console console            # system console
#ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
#ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
#ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
#ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
#ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag
ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmo
n/persistence/runlevel4_flag"
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
#ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
a0:3:off:/usr/sbin/getty -h ttyd2a1 1200
a1:3:off:/usr/sbin/getty -h ttyd2a2 1200
#

And bellow is the paste:

# # more /etc/inittab
init:3:initdefault:
# init:3:initdefault:
stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar </dev/systty
brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck, etc.
link::wait:/sbin/sh -c "/sbin/rm -f /dev/syscon;                        /sbin/ln /dev/systty /dev/syscon" >/dev/console
2>&1
cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon           # legal req
sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1           # system init
#powf::powerwait:/sbin/powerfail >/dev/console 2>&1            # powerfail
cons:123456:respawn:/usr/sbin/getty console console            # system console
#ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
#ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
#ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
#ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
#ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag
ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmo
n/persistence/runlevel4_flag"
ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
#ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
a0:3:off:/usr/sbin/getty -h ttyd2a1 1200
a1:3:off:/usr/sbin/getty -h ttyd2a2 1200
sh: init:3:initdefault::  not found.
# ioin::sysinit:/sbin/ioinitrc >/dev/console 2>&1
# tape::sysinit:/sbin/mtinit > /dev/console 2>&1
# muxi::sysinit:/sbin/dasetup   </dev/console >/dev/console 2>&1 # mux init
# stty::sysinit:/sbin/stty 9600 clocal icanon echo opost onlcr ixon icrnl ignpar </dev/systty
sh: stty::sysinit:/sbin/stty:  not found.
# brc1::bootwait:/sbin/bcheckrc </dev/console >/dev/console 2>&1 # fsck, etc.
#               /sbin/ln /dev/systty /dev/syscon" >/dev/console                                                      <
sh: link::wait:/sbin/sh:  not found.
# 2>&1
# cprt::bootwait:/sbin/cat /etc/copyright >/dev/syscon           # legal req
sh: cprt::bootwait:/sbin/cat:  not found.
# sqnc::wait:/sbin/rc </dev/console >/dev/console 2>&1           # system init
# #powf::powerwait:/sbin/powerfail >/dev/console 2>&1            # powerfail
# cons:123456:respawn:/usr/sbin/getty console console            # system console
sh: cons:123456:respawn:/usr/sbin/getty:  not found.
# #ttp1:234:respawn:/usr/sbin/getty -h tty0p1 9600
# #ttp2:234:respawn:/usr/sbin/getty -h tty0p2 9600
# #ttp3:234:respawn:/usr/sbin/getty -h tty0p3 9600
# #ttp4:234:respawn:/usr/sbin/getty -h tty0p4 9600
# #ttp5:234:respawn:/usr/sbin/getty -h tty0p5 9600
# ems1::bootwait:/sbin/rm -f /etc/opt/resmon/persistence/runlevel4_flag
sh: ems1::bootwait:/sbin/rm:  not found.
# ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag
sh: ems2::bootwait:/sbin/cat:  not found.
# /persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmo                                                     <
> n/persistence/runlevel4_flag"
sh: ems3:3456:wait:/sbin/sh:  not found.
# ems4:3456:respawn:/etc/opt/resmon/lbin/p_client
sh: ems4:3456:respawn:/etc/opt/resmon/lbin/p_client:  not found.
# #ups::respawn:rtprio 0 /usr/lbin/ups_mond -f /etc/ups_conf
# a0:3:off:/usr/sbin/getty -h ttyd2a1 1200
sh: a0:3:off:/usr/sbin/getty:  not found.
# a1:3:off:/usr/sbin/getty -h ttyd2a2 1200
sh: a1:3:off:/usr/sbin/getty:  not found.
#

Best Answer

Did i messed up something really bad? I am afraid that the system won't boot next time?

No and yes (i.e., the system will boot fine -- or at least, this won't have created a problem). You may now have some odd named files in your current working directory (which you can now delete), but it looks like most of that was rejected as commands "not found". inittab is actually not a shell script, so any lines in there that make some kind of sense to the shell do so purely by coincidence.

There are a couple of things:

ems2::bootwait:/sbin/cat </dev/null >/etc/opt/resmon/persistence/reboot_flag

You found that one. I would guess it would be an error with no stdout output, so the file would have been truncated to zero. However, that's what it would do when run properly too; evidently this is just a file node used as a flag (i.e., its existence indicates something, but it has no content).

ems3:3456:wait:/sbin/sh -c "/usr/bin/touch /etc/opt/resmon/persistence/runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmon/persistence/runlevel4_flag"

The chmod at the end of that might have executed, although probably not since it is quoted -- this depends on whether your cut 'n' paste was from somewhere that introduced a newline with line breaks, producing e.g.:

runlevel4_flag; /usr/bin/chmod 644 /etc/opt/resmon/persistence/runlevel4_flag"

The part after the colon would then be a real command, but runlevel4_flag" would not be a real file.

Be careful when working as root. Only do it if you need to. If you aren't working as the superuser, then stuff like this can't do any real harm.