Sponsored Content
Full Discussion: HEREDOC with fdisk
Top Forums Shell Programming and Scripting HEREDOC with fdisk Post 302356758 by pludi on Sunday 27th of September 2009 12:47:15 PM
Old 09-27-2009
Try this:
Code:
#!/bin/bash


HEREDOC_VAR_1=1


HEREDOC_VAR_2='p
q
'


HEREDOC_VAR_3='p
p
q
'

echo $HEREDOC_VAR_1
echo $HEREDOC_VAR_2
echo $HEREDOC_VAR_3

echo "$HEREDOC_VAR_2" | fdisk /dev/sda

 

10 More Discussions You Might Find Interesting

1. Solaris

using fdisk

how do i know my disk partion using fdisk (4 Replies)
Discussion started by: seyiisq
4 Replies

2. Shell Programming and Scripting

Problem in SFTP using heredoc

Hi, I'm having heredoc to get files from ftp server. #!/bin/bash /export/opt/SCssh/3.7.1_C0/bin/sftp csi@192.168.1.100 <<GET_FILES lcd /WEBSERVER_LINK/data_logs/ ls -l pub/csidata/GeneralAppFields_8_1_Feed.out pub/csidata/CtcCatalog_7_3_3_Feed.out get... (13 Replies)
Discussion started by: bheeshmaraja
13 Replies

3. Shell Programming and Scripting

heredoc error check

Hi, Is there any way to check the error in heredoc? Code: /export/opt/SCssh/3.7.1_C0/bin/sftp -B - csi@192.168.1.100 <<FTP lcd /WEBSERVER_LINK/data_logs/ ls pub/csidata/GeneralAppFields_8_1_Feed.out get pub/csidata/GeneralAppFields_8_1_Feed.out quit FTP Now I want to check... (1 Reply)
Discussion started by: bheeshmaraja
1 Replies

4. Solaris

fdisk

Hi All, fdisk -l in linux equals in fdisk option in Solaris Thanks.......... (2 Replies)
Discussion started by: pvkarthykeyan
2 Replies

5. Shell Programming and Scripting

Variables in heredoc

I currently use this message to send e-mails in a script but I would also like to save the output of this code to a file as well while preserving the variables. What's the easiest way to accomplish this? #Sending mail notification when=`/bin/date` /usr/sbin/sendmail -t >2 <<-EOM... (2 Replies)
Discussion started by: woodson2
2 Replies

6. BSD

OpenBSD fdisk - Linux fdisk compatibility ?

Hello, MBR partition table made by linux fdisk looks certainly not correct when printed by openbsd fdisk: Partition table created on linux (centos 6.3): # fdisk -l /dev/sdc Disk /dev/sdc: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 *... (2 Replies)
Discussion started by: vilius
2 Replies

7. Shell Programming and Scripting

Calling sqlplus from Korn shell heredoc issue

Hi, I am facing an issue wherein some temporary files (here docs) are getting created in /tmp and are not getting deleted automatically. When i check the list of open files with below command i can see one file is getting appended continuously.(In this case /tmp/sfe7h.34p) The output is... (4 Replies)
Discussion started by: Navin_Ramdhami
4 Replies

8. Shell Programming and Scripting

Echo multi-line string via heredoc syntax

$ cat bashtest #!/usr/local/bin/bash echo <<<"EOF" line1 line2 line3 EOF $ ./bashtest ./bashtest: line 3: line1: command not found ./bashtest: line 4: line2: command not found ./bashtest: line 5: line3: command not found ./bashtest: line 6: EOF: command not found What am i doing... (4 Replies)
Discussion started by: urello
4 Replies

9. Shell Programming and Scripting

How To Concatenate Two Commands in script using heredoc?

Hello, I am trying to place two commands in heredoc below is the snippet if ;then actionOnTux="$actVerb" else actionOnTux="$actVerb" fi echo "Performing ACTION: $action on $tux@$srv .....\n" if ; then ... (5 Replies)
Discussion started by: kataria.anand
5 Replies

10. Shell Programming and Scripting

Information on heredoc

Hi , I am using ksh on Aix 7.1 and found the below code in a script which is a bit confusing to me, any help will be appreciated <<comments put ${pathforfiles}/${ftpfilename} put ${logs}/${filename}.sch put ${logs}/${filename}.tgr comments I have searched for information on heredoc but... (2 Replies)
Discussion started by: zulfi123786
2 Replies
INTVAL(3)								 1								 INTVAL(3)

intval - Get the integer value of a variable

SYNOPSIS
int intval (mixed $var, [int $base = 10]) DESCRIPTION
Returns the integer value of $var, using the specified $base for the conversion (the default is base 10). intval(3) should not be used on objects, as doing so will emit an E_NOTICE level error and return 1. PARAMETERS
o $var - The scalar value being converted to an integer o $base - The base for the conversion Note If $base is 0, the base used is determined by the format of $var: o if string includes a "0x" (or "0X") prefix, the base is taken as 16 (hex); otherwise, o if string starts with "0", the base is taken as 8 (octal); otherwise, o the base is taken as 10 (decimal). RETURN VALUES
The integer value of $var on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1. The maximum value depends on the system. 32 bit systems have a maximum signed integer range of -2147483648 to 2147483647. So for example on such a system, intval('1000000000000') will return 2147483647. The maximum signed integer value for 64 bit systems is 9223372036854775807. Strings will most likely return 0 although this depends on the leftmost characters of the string. The common rules of integer casting apply. EXAMPLES
Example #1 intval(3) examples The following examples are based on a 32 bit system. <?php echo intval(42); // 42 echo intval(4.2); // 4 echo intval('42'); // 42 echo intval('+42'); // 42 echo intval('-42'); // -42 echo intval(042); // 34 echo intval('042'); // 42 echo intval(1e10); // 1410065408 echo intval('1e10'); // 1 echo intval(0x1A); // 26 echo intval(42000000); // 42000000 echo intval(420000000000000000000); // 0 echo intval('420000000000000000000'); // 2147483647 echo intval(42, 8); // 42 echo intval('42', 8); // 34 echo intval(array()); // 0 echo intval(array('foo', 'bar')); // 1 ?> NOTES
Note The $base parameter has no effect unless the $var parameter is a string. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | Throws E_NOTICE and returns 1, when an object is | | | passed to $var. | | | | +--------+---------------------------------------------------+ SEE ALSO
boolval(3), floatval(3), strval(3), settype(3), is_numeric(3), Type juggling, BCMath Arbitrary Precision Mathematics Functions. PHP Documentation Group INTVAL(3)
All times are GMT -4. The time now is 03:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy