The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Read the csv file and assign the values in to variable rajbal Shell Programming and Scripting 11 06-27-2009 01:17 PM
How to pass values from one file to different scripts pssandeep UNIX for Dummies Questions & Answers 6 12-14-2007 07:14 PM
Read through a file and Pass system commands systemali Shell Programming and Scripting 7 03-27-2006 03:14 AM
How can I read variable values from file? redlotus72 UNIX for Dummies Questions & Answers 1 03-14-2005 05:38 AM
read a file as input and pass each line to another script sajjad02 Shell Programming and Scripting 0 09-24-2004 11:13 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-20-2008
nix-kid nix-kid is offline
Registered User
  
 

Join Date: May 2008
Posts: 1
how do I pass or read values from file ?

Hi one & All ,

My Need is to Create 64 Partition and create File System in Linux.

I have the Script ...

for((a=0;a<=63;a++))
do
fdisk /dev/cciss/c0d$a
done

for((a=0;a<=63;a++))
do
mkfs.ext2 /dec/cciss/'c0d'$a'p1'
done


the moment I run the Script I get the Prompt ...

Command (m for help) : n ( is the value I Enter )
command action
e extended
p primary partition (1-4)

p ( is the Value I Enter)
partition number (1-4) : 1
First cylinder (1-251, default 1): 1
Last cylinder or +size or +sizeM or +sizeK (1-251, default 251): 251
command ( m for help) :w

So as you see , I Basically provide 64 times the Values

n
p
1
1
251
w

please help ,is there way i can pass these Values in loop so I dont have to Enter Manually

I'm still @ Learning , so would be grateful if some GURU here helps

Regards
  #2 (permalink)  
Old 05-20-2008
fabtagon fabtagon is offline
Registered User
  
 

Join Date: Apr 2008
Location: European Union/Germany
Posts: 189
Put the things you type in a file (1 thing on 1 line) und use like

fdisk /dev/whatever < filename

Other option would be to use sfdisk (scriptable fdisk replacement) which is amoung other things able to "nuke in" a new partition table with one command.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0