using the 'format' command non-interactively in a script

Ask a Question related to Sun Solaris, Design and Development.

  1. #1

    Default using the 'format' command non-interactively in a script

    hi ,
    i am a bit new to solaris. but anyways i just wanted to use the format
    command and have the disk-status into a file
    ie. if i give
    format -d c0t1d0
    it would give a menu
    now if i type 'verify'
    the output which would be generated is what i want to be redirected to
    a log/txt file..

    i wanted this so that a script would inwoke the format and send the
    'verify' output to the log file.

    any way to do this.
    DukeNM Guest

  2. Similar Questions and Discussions

    1. Using tell taget command in slideshow format
      I am using flash mx 2004 professional on a win2k system. I am currently using one of the new features exclusive to the pro version called slideshow....
    2. My Script to run a Command-Line from ASP does not work
      Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is...
    3. script+file format
      Hello, I am looking for a perl script to detect and display a format of file (i.e. unix, dos or mac). I will be very grateful to you to help...
    4. kill command in a perl script
      I just started learning Perl and I am trying to do followings; ps -ef | grep java >pidfile In pidfile, there are 3 PIDs for weblogic processes. ...
    5. Windows Explorer Right Click Command (+ Custom Command Script)
      Ok got a tricky question about custom scripts, I would like to add a Windows Explorer Right Click Command - that allows me to select an image/s...
  3. #2

    Default Re: using the 'format' command non-interactively in a script

    DukeNM wrote:
    > ... a script would inwoke the format and send the
    > 'verify' output to the log file.
    >
    > any way to do this.

    Something along the lines of

    echo "verify" | format -d c0t1d0 > /tmp/format.log perhaps?

    Tony

    Tony Walton Guest

  4. #3

    Default Re: using the 'format' command non-interactively in a script

    [email]tridentadm@netscape.net[/email] (DukeNM) wrote in message news:<6b07a80.0307310215.78aa3cc9@posting.google.c om>...
    > hi ,
    > i am a bit new to solaris. but anyways i just wanted to use the format
    > command and have the disk-status into a file
    > ie. if i give
    > format -d c0t1d0
    > it would give a menu
    > now if i type 'verify'
    > the output which would be generated is what i want to be redirected to
    > a log/txt file..
    >
    > i wanted this so that a script would inwoke the format and send the
    > 'verify' output to the log file.
    >
    > any way to do this.
    Try something like that ( it is not smart, but it works) :




    echo " " >> $Z
    echo "--------------------------------- " >> $Z
    echo "-------- format -------- " >> $Z
    echo "--------------------------------- " >> $Z
    echo " " >> $Z


    echo "disk" > /tmp/InputFile.$$
    /usr/sbin/format -f /tmp/InputFile.$$ >> $Z 2>&1
    /usr/bin/rm /tmp/InputFile.$$


    echo " " >> $Z


    echo " " >> $Z
    echo "--------------------------------- " >> $Z
    echo "- 1. int. Disk: partition table - " >> $Z
    echo "--------------------------------- " >> $Z
    echo " " >> $Z


    file=/tmp/file$$

    # get the first internal disk's name

    echo "disk 0 q" > $file
    set -- `format -f $file | grep selecting`
    a=`echo $2`

    # get the first internal disk's partition table

    echo "format $a <<EOF" > $file
    echo "p" >> $file
    echo "p" >> $file
    echo "q" >> $file

    chmod 700 $file
    $file >> $Z 2>&1
    rm $file

    echo " " >> $Z
    stefan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139