Sponsored Content
Top Forums Shell Programming and Scripting Automating partitioning setup of /dev/sda on /dev/sdc Post 302944905 by RudiC on Saturday 23rd of May 2015 10:12:31 AM
Old 05-23-2015
I'm not familiar with sgdisk and wouldn't know how to construct commands for it. To extract the desired values form above mentioned output, try
Code:
sgdisk -p /dev/sda |
while read partnum startsec endsec size unit parttype name
   do [[ $partnum =~ [[:digit:]]{1,2} ]] &&
        echo $partnum $startsec $endsec $size $parttype $name
   done
1 2048 411647 200.0 EF00 EFI System Partition
2 411648 1435647 500.0 8300
3 1435648 1464401919 697.6 8300

You'd need to assign the values to e.g. an array in lieu of the echo, then.
 

9 More Discussions You Might Find Interesting

1. Solaris

URGENT - setup port and dump all output to /dev/null or a file

Please help urgently. I need to setup up some sort of service on a solaris server on a port. I dont need it do anything special, anything that is sent to this port from an external server should be dump to /dev/null or a flat file.. Can you help urgently? (1 Reply)
Discussion started by: frustrated1
1 Replies

2. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

3. UNIX for Dummies Questions & Answers

Sending alt-n to /dev/pts/1 from process bound to /dev/pts/2

Hello, i am using finch (unix commandline instant messaging client using libgnt) which is running connected to /dev/pts/1 Now I would like to "remote control" the program by sending the key combinations normally typed on the keyboard from a programm in another shell. So I tried:... (0 Replies)
Discussion started by: mentos
0 Replies

4. Slackware

CUPS setup / dev/lp0 perms. ... Slow printing.

Hello, Ive got an HP LaserJet 2100 / parallel interface. I had some troubles getting going due to non-working cups drivers. Updated cups and also used a .ppd.gz file from something HP provided. found the files here... www.linuxprinting.org/show_printer.cgi?recnum=HP-LaserJet_2100 Anyways.... (1 Reply)
Discussion started by: agentrnge
1 Replies

5. Solaris

Lun remove, stuck in /dev/dsk and /dev/rdsk

So, we removed a LUN from the SAN and the system is refusing to remove the references to it in the /dev folder. I've done the following: devfsadm -Cv powermt -q luxadm -e offline <drive path> luxadm probe All those commands failed to remove the path. The drive stills shows up as <drive... (13 Replies)
Discussion started by: DustinT
13 Replies

6. AIX

Difference between /dev/hdisk and /dev/rhdisk

Hi, How can i check that i am using RAW devices for storage in my AIX machine... Also after adding a LUN from storage to a aix host, when i check /dev in the host, i can see both rhdisk and hdisk with same number eg: dcback1(root):/dev>ls -lrt | grep disk12 crw------- 1 root ... (4 Replies)
Discussion started by: jibujacob
4 Replies

7. AIX

Problem in /dev/hd1 and /dev/hd9var

Hello AIXians, I can't boot my AIX, it hangs and stops at the code error: 0518 After searching google, I knew the problem is due to problems in File Systems. So the solution is booting from any bootable media, then run these commands in maintenance mode: #fsck -y /dev/hd4 #fsck -y... (3 Replies)
Discussion started by: Mohannad
3 Replies

8. Red Hat

Changing grub from /dev/sda to /dev/sdb

Hi, Please suggest steps to change grub from /dev/sda to /dev/sdb, (1 Reply)
Discussion started by: manoj.solaris
1 Replies

9. HP-UX

Dev/urandom and dev/random missing in HP-UX

Hi, In our HP-UX B.11.11. I could not find dev/urandom and dev/random Are all pseudo-devices implemented as device drivers, or in need to run /configure some package to install the package to have dev/urandom. Please help (4 Replies)
Discussion started by: rashi
4 Replies
UNITS-FILTER(1) 					     units-filter User Manual						   UNITS-FILTER(1)

NAME
units-filter - is a parser for physical and chemical quantities SYNOPSIS
units-filter -s -o -l DESCRIPTION
units-filter is a basic standalone parser written in C language, flex and bison. It inputs strings like "1.5e3 nN.m.s^-1" (it could be the time growth ratio of a torque) and outputs the value in standard SI unit, followed by the physical dimension of this value. OPTIONS
-s Like Significant. Takes in account the number of significant digits. For example 1.0 m contains 2 significant digits, while 0.00100 contains 3 significant digits. It is possible to enforce the number of significant digits by using a special syntax : if units-filter parses the input "1.0m#6", it interprets it as a value with exactly 6 significant digits, like "1.00000 m". The number following the # sign is the forced number of significant digits. The number of significant digits appears just before the last zero in the output of the command (this zero is a placeholder for future extensions). -o Like Output. Outputs a correct representation of the physical quantity with its physical unit in the International System notation. There may be some simplification with usual units. For example, a newton will be represented by the unit N in place of m.kg.s^-2. The value is expressed as a floating number with one digit before the decimal point, and as many digits in the mantissa as necessary to fit the desired number of significant digits (see an example below). It is possible to enforce the output unit : just add a colon and the desired unit at the end of the input. If this unit is homogeneous with the former one, it will be used to format the output. -l Like LaTeX. Outputs a correct representation of the physical quantity with its physical unit in the International System notation, in LaTeX language. EXAMPLES
Establish the SI value and unit exponent of a quantity in the mksa system: ~$ echo 1.5e3 nN.m.s^-1 | units-filter 1.5e-6 2 1 -3 0 0 0 0 which means : 1.5e-6 (SI unit) m^2.kg.s^-3 Compare different physical quantities: ~$ e1=$(echo "1.2e-3 V" | units-filter) ~$ e2=$(echo "1200e3 nWb/s"| units-filter) ~$ if [ "$e1" = "$e2" ]; then echo ok; else echo ko; fi ok ... which emphasizes that webers by unit time are the same as volts. Playing with the number of significant digits: ~$ echo "0.00100m" | src/units-filter -s 0.001 1 0 0 0 0 0 0 3 0 ~$ echo "0.00100m #2" | src/units-filter -s 0.001 1 0 0 0 0 0 0 2 0 Giving a value for the relative precision: ~$ echo "1kV~2" | units-filter -o 1e+03 V +-2% Turning on the LaTeX output: ~$ echo "1kohm+-2%" | units-filter -l 1 imes 10^{+03}, Omega pm 2,\% Turning on the output of a canonical physical notation: ~$ echo "1.0 m.kg.s^-2 #7" | units-filter -o 1.000000e+00N Choosing a non-standard unit for the output: ~$ echo 1800C:A.h| units-filter -o 5.000e-01 A.h KNOWN BUGS
Few units out of the mksa system are successfully parsed. AUTHOR
Georges Khaznadar <georgesk@ofset.org> Wrote this manpage. COPYRIGHT
Copyright (C) 2009 Georges Khaznadar Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. units-filter 11/19/2011 UNITS-FILTER(1)
All times are GMT -4. The time now is 02:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy