![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to sort a string with numbers | ahjiefreak | Shell Programming and Scripting | 5 | 12-21-2007 10:52 AM |
| to find numbers in a string | fongthai | Shell Programming and Scripting | 12 | 11-22-2007 04:34 PM |
| Extract numbers from a string and store in variables | davewg | Shell Programming and Scripting | 6 | 11-14-2007 05:22 AM |
| perl: string comparison as numbers | bishweshwar | UNIX for Advanced & Expert Users | 7 | 05-27-2007 01:54 AM |
| output only numbers from mixed string | nortypig | Shell Programming and Scripting | 10 | 08-29-2006 11:30 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How do i get numbers from a string?
Hi...
I'm new here and i have a Q... How do i get only the number from a string? like from "rlvol11" i want to get 11 or from "lvol4" i want to get 4 what commands should i use at my script? thanx 4 the help! Eliraz. |
|
||||
|
hi again...
First of all thanx!
it worked but i still have a problem with my script... i want to make a script that gets a VG name and outputs the size of it's lvols... here is what i wrote but it doesn't work... ![]() Code:
for x in *
do
if [ "echo $x" = "lvol*" ]; then
echo $x | tr -d '[A-Za-z]' | read lvolnum
echo /dev/$1/lvol$lvolnum
lvdisplay lvol${lvolnum} | grep Mbytes
fi
done
thanx alot! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|