![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| FDISK problems | woodson2 | Red Hat | 2 | 03-30-2009 10:14 AM |
| using fdisk | seyiisq | SUN Solaris | 4 | 11-22-2008 04:17 AM |
| Using fdisk in scripts | Frank_a | UNIX for Dummies Questions & Answers | 1 | 02-11-2005 09:46 AM |
| (c)fdisk and RedHat 7.2 | 98_1LE | UNIX for Dummies Questions & Answers | 1 | 01-17-2002 03:38 AM |
| I need fdisk that works with dos and unix | gparsons70 | UNIX for Dummies Questions & Answers | 1 | 10-28-2001 10:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
HEREDOC with fdisk
Hi folks What I'm trying is to build a partitioning script. I can pass a HEREDOC to fdisk just fine. Like this: Code:
fdisk /dev/sda << EOF p q EOF but I don't know how to put that HEREDOC into a varible to pass it to fdisk. This is what I have tried so far (no luck) Code:
#!/bin/bash HEREDOC_VAR_1=1 HEREDOC_VAR_2=$(cat <<EOF p q EOF ) HEREDOC_VAR_3=$(cat <<'EOF' p p q EOF ) echo $HEREDOC_VAR_1 echo $HEREDOC_VAR_2 echo $HEREDOC_VAR_3 fdisk /dev/sda << $HEREDOC_VAR_2 echo "this works somehow but gets multiple p from former variables..." fdisk /dev/sda << EOF p q EOF ANY Help is greatly appreciated....my head hurts from this...I just can not figure it out.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|