Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

fdisk in a script

Posted on 2001-09-06
4
Medium Priority
?
1,625 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview
Suggested Courses
Course of the Month10 days, 1 hour left to enroll

926 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