The UNIX and Linux Forums  
Hello and Welcome from to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with dd command or maybe AFS problem Anta Shell Programming and Scripting 0 08-25-2006 11:10 AM
SSH Problem auth problem budrito UNIX for Advanced & Expert Users 1 03-17-2004 10:12 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-16-2008
netmedic netmedic is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 12
AWK Problem Need Help!

I have a problem that I have not be able to get solved. First of all the script I am writing is for a Windows server. I am trying to write a script that will connect to a ISCSI SAN and locate the last Snapshot for that server and mount it for a backup. In order to capture the screens I have been redirecting the output to a text file then using CYGWIN and GAWK to parse the file and extract the information I need to pass into another file which is named a bat file which is executed for the next step. I have everything working except the last critical step. When I connect to the snapshot the volume does not mount with a drive letter. When I run a diskpart I can see the disk number (without a letter). I then need to run a few diskpart commands to connect to the volume before I can assign a letter of my choice.

Now for the issue. The output of the file is a follows:

Volume 0<sp> Data NTFS Partition 400 GB Healthy
Volume 1 Z <sp><sp> DVD-ROM 0 GB Healthy
Volume 2 C <sp> NTFS Partition 21 GB Healthy System
Volume 3 D Data1 NTFS Partition 115 GB Healthy
(<sp> is there only to indicate there is a blank space)

What I need to do is extract the line that does not have a drive letter. I would like to use awk for this. The problem is that this line is not always the first line nor Volume 0. The only thing that is constant is that is will not have a drive letter. When I try a $3 for the third field it treats the word Data as the third field since its blank. I was hopeing something like

$3 // { print $1, $2 }

Can any one help?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0