Hang when run command with /dev/console

hi guys,

I don't know why I run this command:

echo a>/dev/console

It is not responsed from console and hang. If I run echo a>/dev/null, it is OK.
here it is the console file:

mcl1101 root#ls -ltr /dev/console
lrwxrwxrwx   1 root     other         30 Aug 18  2009 /dev/console -> ../devices/pseudo/cn@0:console
mcl1101 root#ls -ltr /devices/pseudo/cn@0:console
crw--w----   1 root     tty        0,  0 Dec 30 22:52 /devices/pseudo/cn@0:console

Can anyone help me?

thanks you a lot.
Br.

Did you mean to use /dev/tty? /dev/console is owned by another process, owned by root. What are you trying to do? Write a message on the console? if so, try the write command. It allows you to specify both a user and a specific device as the destination for a message.

@ Jim mcnamara:

I think I meet the problem with console. in other devices such as: tty, tty0, It run OK.
Can i restart the /dev/console? or link the /dev/tty to the /dev/console?

thanks you a lot and happy new year. :slight_smile:
br.

You probably don't have access to write to /dev/console and generally have no reason to do so. What are you actually trying to do, and why?

hi Corona688

Because in crontab file, it have a command:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/xpg4/bin/date >/dev/console 2>&1

I found that the /dev/console don't work. so that cron daemon is hang.

thanks you,
Br.