The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]

Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Re: shell eating $
Author: Chris Elvidge 
Date:   19-08-10 08:54

Too many quotes, try this:

#!/bin/sh
loaded="Data Transfer Element 0:Full (Storage Element 2 Loaded):VolumeTag = DGG440"
echo "loaded=$loaded"
echo $loaded | awk '{ print $7 }'

echo before
slot=$(echo $loaded | awk '{ print $7 }')
echo after

echo "slot=$slot"

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 shell eating $   new
Dan 18-01-10 00:55 
 Re: shell eating $   new
Chris Elvidge 19-08-10 08:54 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org