|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
what does this command do?
Hi all,
I would like to know how this command works exec </dev/console >/dev/console 2>&1 Also please pay particular attention to the syntax and i would like to know if the syntax is correct (particularly the spacing!!) Am trying to debug a script at boot time and am not getting any errors so thought i would use this to figure out what's going wrong? Thanks |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
What type of script are you trying to debug ?
Anything in the rc.log ?? |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
well not an rc script in the technical sense, but its a boot up script that does all the loading of drivers and mounting FS from the cdrom to respective places....
Am actually working on a opensolaris distro. And here the notion of rc scripts is obsolete ,its in the form of services and milestones!!! could you shed some light on it now? |
|
#4
|
||||
|
||||
|
Sorry wrapster, never dealt with opensolaris.
Be patient, someone's bound to know and provide some light. |
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
ok ,
No problem,thanks for taking interest |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
exec in this form is for redirecting the file descriptors of the process. Think of it this way; if you always want to do "myscript 2>/tmp/fnord 1>&2" then you can say this inside myscript, right at the beginning: Code:
exec 2>/tmp/fnord 1>&2 Then the redirections are no longer needed at the prompt when you run myscript. So in your example, the script's input file descriptor (what every command will be reading from if not given a file argument -- read, cat, grep, you name it) from that point on is /dev/console, output from all commands will go to /dev/console (unless separately redirected, of course), and errors will go to the same (2>&1 means send standard error where-ever standard output is). |
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| passing command output from one command to the next command in cshell | kaaliakahn | UNIX for Dummies Questions & Answers | 2 | 02-10-2012 04:59 PM |
| unix command : how to insert text at the cursor location via command line? | xib.be | UNIX for Advanced & Expert Users | 0 | 12-22-2010 05:45 PM |
| Need help! command working ok when executed in command line, but fails when run inside a script! | 4dirk1 | Shell Programming and Scripting | 4 | 12-02-2010 05:47 AM |
| awk command in script gives error while same awk command at prompt runs fine: Why? | catalys | Shell Programming and Scripting | 4 | 09-20-2010 10:07 PM |
| awk/sed Command : Parse parameter file / send the lines to the ksh export command | rajan_san | Shell Programming and Scripting | 4 | 11-06-2008 12:29 PM |
|
|