Solved

fdisk in a script

Posted on 2001-09-06
4
1,612 Views
Last Modified: 2008-03-06
Hello,

I would like to create partitions on a 2nd hard drive in a script.  Is it possible to do an fdisk command in a script?  What would it look like?

Thanks in advance for the help!
0
Comment
Question by:diamond1
  • 3
4 Comments
 
LVL 5

Expert Comment

by:garboua
ID: 6460710
I think you could, but I wouldn't do that.  U probably want to do that interactively.
0
 
LVL 1

Accepted Solution

by:
zmanz earned 100 total points
ID: 6462118
#!/bin/bash
# This example prints out the help and partition info  and then quits.
fdisk /dev/hda <<END
m
p
q
END
0
 
LVL 1

Expert Comment

by:zmanz
ID: 6462170
The above script example uses a here document.
http://www.linuxdoc.org/LDP/abs/html/here-docs.html
0
 
LVL 1

Expert Comment

by:zmanz
ID: 6480842
knock knock
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
why should double free() crash? 7 35
idM Identity Management in Red Hat 6 - setting up 9 269
Problem to run file 9 130
busybox bash/ash - bash -x | grep 19 187
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question