Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Shell Script question

  • 28-01-2004 5:25pm
    #1
    Registered Users, Registered Users 2 Posts: 95 ✭✭


    Right,

    Lets say i have a shell script to insmod a list of modules..

    so it might execute a command like:
    insmod pcmcia_core

    As well as whatever output of the shell script, insmod will give the output:
    Linux Kernel Card Services VERSION
    options: [pci] [cardbus]

    Now lets say I dont want to see the insmod output.. I would have thought I could do something like this:
    insmod pcmcia_core >/dev/null

    But no... I still get the insmod splurge.. So I try:
    insmod pcmcia_core >/dev/null 2>/dev/null
    which seesm to do something.. but doenst stop the output of insmod getting to the console..

    Could anyone tell me how to stop these insmod messages from displaying? I think the problem is coz insmod uses printk() to display the message and i dont know how to redirect the filestream.. But then I could be totally off the mark.

    Any help appreciated :)


Comments

  • Registered Users, Registered Users 2 Posts: 491 ✭✭Silent Bob


    insmod 2&> /dev/null

    at least if you are using bash...


  • Registered Users, Registered Users 2 Posts: 95 ✭✭fractal


    Thanks, but...

    Sorry should probably have mentioned, im using "ash"...

    I know.. Strange choice but tis for a system based on busybox and uclibc..

    Anyways long story short "insmod 2&>" doesnt work :(

    But ash is pretty much POSIX-compliant, or so ive read, so there must be some way? (/me crosses fingers)

    I must keep looking..


  • Registered Users, Registered Users 2 Posts: 491 ✭✭Silent Bob


    insmod module_name 2> /dev/null works for me in ash


  • Registered Users, Registered Users 2 Posts: 95 ✭✭fractal


    For me,

    It works if youre login terminal isnt /dev/console

    ie: if you've sshed into the box it'll redirect the output off your ssh tty...

    Still seems to get through to /dev/console though...

    Or am i wrong? Try it for pcmcia_core module.. The insmod message (Using moduleName message) seems to be on STDOUT and can be redirected easily using > /dev/null

    But the next bit ie: "Linux Card Services" doesnt go away..

    BAH HUMBUG!


  • Closed Accounts Posts: 53 ✭✭dmd


    This is probably syslog then. If you want to disable this you can, just find what it's using in /etc/syslog.conf, but this maybe a bad idea. Could you say put them out to /dev/tty2 for example, so you have to hit control alt f2 to look at it.

    Google for syslog+youros+console .


  • Advertisement
  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    insmod blah 2>&1 &


  • Registered Users, Registered Users 2 Posts: 95 ✭✭fractal


    Strange..

    Thanks everyone... All good suggestions.. Make sense.. Should be as easy as all that but it doesnt seem to be.

    dmd: syslog wasnt running on this machine in question.. Reason being its an early stages distro in development. So it wasnt sending the messages to the wrong tty, coz it wasnt there.. :(

    Typedef: inmod blah 2>&1 &
    This will send filestream 2 [thats stderr] to the same place as filestream 1 [stdout] and run the command in the background.

    To be honest Im not sure its stderr i need to redirect as I _CAN_ alter where errors go with 2>/dev/null and where load messages go with >/dev/null..

    I think theres a 3rd one im missing when certain modules load.. kernel msgs or somehting...

    To be honest this isnt all that critical.. Tisjust to make the init routine look more purty on boot..

    Thanks for suggestions so far anyways..

    /me should probably sleep on it


Advertisement