05-26-2013
Hi RudiC...
Liked the look of the code and tried it out...
Worked as expected but it was no faster than Don's reply.
But I do like the idea... That is logged in the old grey matter for future use...
Thanks...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have a korn shell string variable
str1 = "A,B,Z"
I would like to create another korn shell string variable
str2 = "letter = 'A' or letter = 'B' or letter = 'Z' "
Please help!
Thanks in advance
an UNIX newbie! (13 Replies)
Discussion started by: hai1973
13 Replies
2. Shell Programming and Scripting
Hey Guys,
Right i know how to alter a word to begin with a capital letter, i know how to remove unwanted characters and replace them with the relevant character however i don't now if there is a way to do them all in one line.
Code:
echo -n ${string:0:1} | tr a-z A-Z #convert first letter... (4 Replies)
Discussion started by: shadow0001
4 Replies
3. Shell Programming and Scripting
i have a file that contains a pattern like this:
ajay 1234 newyork available
kumar 2345 denver
singh 2345 newyork
ajay 3456 denver
kumar 3456 newyork
singh 3456 delhi available
ajay 4567 miami
kumar 4567 miami
singh 4567 delhi
i want to search for each line... (5 Replies)
Discussion started by: ajay41aj
5 Replies
4. Shell Programming and Scripting
if I have two string variable, how do I add one to anther.
like
a= "a"
b="b"
c=$a+$b
but that doesn't work.
Is there anyway to solve it.http://www.qtl.co.il/img/copy.pnghttp://www.google.com/favicon.icohttp://www.babylon.com/favicon.icohttp://www.morfix.com/favicon.ico (2 Replies)
Discussion started by: programAngel
2 Replies
5. Shell Programming and Scripting
Hi Guru's,
I need some help with data manipulation using shell scripting. I know how to replace the whole string but not part of the string.
The value after aa= should be replaced with the value in the mail leaving ,OU=111,OU=222,DC=333 as is. Below are the inputs and expected outputs.
Input:... (17 Replies)
Discussion started by: Samingla
17 Replies
6. Shell Programming and Scripting
Hi,
I have the followoing details in one file:
opt/tra/domain/test/new/filename1
training/ear/help
I need to manipulate the string in the following manner:
filename1= opt/tra/domain/test/new/filename1
help=training/ear/help
last string is the name and equal sign and then... (2 Replies)
Discussion started by: ckchelladurai
2 Replies
7. Shell Programming and Scripting
i have something like this...
echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }'
Certifica
the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it.
expected output is
Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies
8. Shell Programming and Scripting
Hi ,
I am getting a string like
aaa,bbb,sdsdad,sdfsdf,sdfsdfdsf,rtyrtyr,45654654,ddfdfdfgdfg,dfgdfgdg...........
Now what I need is to format it.
So after each nth comma I need one newline. So the above will look like
when n=3
aaa,bbb,sdsdad,
sdfsdf,sdfsdfdsf,rtyrtyr,... (4 Replies)
Discussion started by: Anupam_Halder
4 Replies
9. Shell Programming and Scripting
I'm making a little game in Perl, and I am trying to remove the first instance of a character in an arbitrary string. For example, if the string is
"cupcakes"and the user enters another string that contains letters from "cupcake" e.g:
"sake"the original string will now look like this (below)... (3 Replies)
Discussion started by: whyte_rhyno
3 Replies
10. OS X (Apple)
i have a string that am looking to extract all characters following 3 consecutiv numbers.
Example my string is J1705PEAN038TDMN, i need to get TDMN
My string can have multiple 3 consecutive numbers, i need what follows last occurance (9 Replies)
Discussion started by: gigagigosu
9 Replies
LEARN ABOUT DEBIAN
cfdisk
CFDISK(8) GNU cfdisk Manual CFDISK(8)
NAME
GNU cfdisk - a curses-based partition table manipulation program
SYNOPSIS
cfdisk [options] [device]
DESCRIPTION
cfdisk is a disk partition manipulation program, which allows you to create, destroy, resize, move and copy partitions on a hard drive
using a simple menu-driven interface. It is useful for organising the disk space on a new drive, reorganising an old drive, creating space
for new operating systems, and copying data to new hard disks. For a list of the supported partition types, see the --list-partition-types
option below.
OPTIONS
-h, --help
displays a help message.
-v, --version
displays the program's version.
-a, --arrow-cursor
use an arrow cursor, instead of reverse video highlighting, in case your terminal doesn't support it.
-z, --new-table
create a new partition table on the disk. This is useful if you want to change the partition table type or want to repartition you
entire drive. Note that this does not delete the old table on the disk until you commit the changes.
-u, --units=UNIT
sets the default display units to UNIT. A list of possible units is given below.
-t, --list-partition-types
displays a list of supported partition types and features.
UNITS
You can choose in what unit cfdisk should display quantities like partition sizes. You can choose from sectors, percents, bytes, kilobytes,
etc. Note that one kilobyte is equal to 1,000 bytes, as this is consistent with the SI prefixes and is used by hard disk manufacturers. If
you prefer to see the sizes in units with binary prefixes, you should instead select one kilo binary byte (kibibyte), which is equal to
1,024 bytes. Whatever display unit you have chosen, you can always enter the quantities in the unit of your choice, for example 1000000B or
1000kB.
compact
display each size in the most suitable unit from B, kB, MB, GB and TB.
B one byte
kB one kilobyte (1,000 bytes)
MB one megabyte (1,000,000 bytes)
GB one gigabyte (1,000,000,000 bytes)
TB one terabyte (1,000,000,000,000 bytes)
KiB one kilo binary byte (1,024 bytes)
MiB one mega binary byte (1,048,576 bytes)
GiB one giga binary byte (1,073,741,824 bytes)
TiB one tera binary byte (1,099,511,627,776 bytes)
s one sector. It depends on the sector size of the disk. You can use it if you want to see or choose the exact size in sectors.
% one percent from the size of the disk
cyl one cylinder. It depends on the cylinder size.
chs use CHS display units.
BUGS
There are no known bugs. We are in early stages for development, so be careful.
SEE ALSO
fdisk(8), mkfs(8), parted(8) The cfdisk program is fully documented in the info(1) format GNU cfdisk User Manual manual.
fdisk 16 June, 2006 CFDISK(8)