Sponsored Content
Full Discussion: unable to redirect output
Top Forums Shell Programming and Scripting unable to redirect output Post 302267531 by lochraven on Friday 12th of December 2008 03:39:48 PM
Old 12-12-2008
unable to redirect output

I have a script on Linux that is using sfdisk to partition a usb drive.

I'm trying to redirectory the standard out and standard error which works, however, there is still messages being diplayed.

I guess it's kernel messages?

Is there a way to redirect this output?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

redirect output to file?

Hi: I am currently working on a program which requires direct its ouput to a file here is an example ./proram arg_1 arg_2 when program ends all output will be arg_2 file Is that possible I am not a bad programmer, However I am stuck there. Can anyone give a hint? Thanks SW (1 Reply)
Discussion started by: slackware
1 Replies

2. UNIX for Dummies Questions & Answers

Redirect Output In Variable

how make assign the output of the command (for example: grep "file" "string" ) in a variable ($name)? i thing how put the result of the command (grep , cut, find ecc) in a variable.. IT's Possible ?? (1 Reply)
Discussion started by: ZINGARO
1 Replies

3. Shell Programming and Scripting

Redirect output

Hi all, I have a script which call a java program, the logging (to log file) in the program is done using log4j. However, as a safety measure, i still choose to direct standard error to another log file as follow /usr/bin/java -classpath ${classpath} -Xmx128m TestingProgram 2>>... (1 Reply)
Discussion started by: mpang_
1 Replies

4. Shell Programming and Scripting

Redirect Output

Hi, I would like to list files: ls *.hdf But I would like a copy of the output directed to the screen, but also APPENDED to a text file: test.txt I have tried: ls *.hdf | tee test.txt However, that will just write over everything already existing in test.txt. How can I append the... (1 Reply)
Discussion started by: msb65
1 Replies

5. Shell Programming and Scripting

output redirect

Hi i am compiling a source code by make command. i want to redirect the output of make to a file but at the same time i want to see the output in terminal. how to do this ?. please suggest your idea. thanks in advance. Saravana ---------- Post updated at 05:24 PM ----------... (2 Replies)
Discussion started by: tsaravanan
2 Replies

6. AIX

Unable to get the full content into a file when I redirect installp command output..

When i use the command to check the preview of the filesets to be installed using CLI # When using this commad 'm able to see all Preview view of the filesets to be installed installp -apgX -d "." all # When I redirected the same output to a file 'm able to see only half the details... (1 Reply)
Discussion started by: Sounddappan
1 Replies

7. Shell Programming and Scripting

How to redirect output of ls to a file?

Hi All, I want to redirect only the file names to a new file from the ls -ltr directroy. how Can i do it. my ls -ltr output will be as below. -rwxr-xr-x 1 118 103 28295 Jul 26 2006 event.podl -rwxr-xr-x 1 118 103 28295 Jul 26 2006 xyz.podl I want my new file... (6 Replies)
Discussion started by: girish.raos
6 Replies

8. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

9. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

10. Shell Programming and Scripting

Unable to redirect output to a file

I m not able to redirect the java version to a file however, it shows as output when I run my script. bash-3.2$ more 1test.tmp java_version=`which java` echo "MY JAVA:"$java_version version=`"$java_version" -version` echo $version >>/tmp/moht/java_version.log $java_version -version 2... (4 Replies)
Discussion started by: mohtashims
4 Replies
CFDISK(8)						       System Administration							 CFDISK(8)

NAME
       cfdisk - display or manipulate a disk partition table

SYNOPSIS
       cfdisk [options] [device]

DESCRIPTION
       cfdisk is a curses-based program for partitioning any block device.  The default device is /dev/sda.

       Note  that  cfdisk  provides  basic partitioning functionality with a user-friendly interface.  If you need advanced features, use fdisk(8)
       instead.

       Since version 2.25 cfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any  functionality  for  CHS	(Cylinder-
       Head-Sector) addressing.  CHS has never been important for Linux, and this addressing concept does not make any sense for new devices.

       Since  version  2.25 cfdisk also does not provide a 'print' command any more.  This functionality is provided by the utilities partx(8) and
       lsblk(8) in a very comfortable and rich way.

       If you want to remove an old partition table from a device, use wipefs(8).

OPTIONS
       -h, --help
	      Display help text and exit.

       -L, --color[=when]
	      Colorize the output.  The optional argument when can be auto, never or always.  If the when argument  is	omitted,  it  defaults	to
	      auto.  The colors can be disabled, for the current built-in default see --help output. See also the COLORS section.

       -V, --version
	      Display version information and exit.

       -z, --zero
	      Start with an in-memory zeroed partition table.  This option does not zero the partition table on the disk; rather, it simply starts
	      the program without reading the existing partition table.  This option allows you to create a new partition table  from  scratch	or
	      from an sfdisk-compatible script.

COMMANDS
       The  commands  for  cfdisk can be entered by pressing the corresponding key (pressing Enter after the command is not necessary).  Here is a
       list of the available commands:

       b      Toggle the bootable flag of the current partition.  This allows you to select which primary partition  is  bootable  on  the  drive.
	      This command may not be available for all partition label types.

       d      Delete  the current partition.  This will convert the current partition into free space and merge it with any free space immediately
	      surrounding the current partition.  A partition already marked as free space or marked as unusable cannot be deleted.

       h      Show the help screen.

       n      Create a new partition from free space.  cfdisk then prompts you for the size of the partition you want to create.  The default size
	      is equal to the entire available free space at the current position.

	      The  size  may  be followed by a multiplicative suffix: KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB
	      (the "iB" is optional, e.g. "K" has the same meaning as "KiB").

       q      Quit the program.  This will exit the program without writing any data to the disk.

       s      Sort the partitions in ascending start-sector order.  When deleting and adding partitions, it is likely that the	numbering  of  the
	      partitions will no longer match their order on the disk.	This command restores that match.

       t      Change the partition type.  By default, new partitions are created as Linux partitions.

       u      Dump the current in-memory partition table to an sfdisk-compatible script file.

	      The script files are compatible between cfdisk, fdisk, sfdisk and other libfdisk applications.  For more details see sfdisk(8).

	      It  is also possible to load an sfdisk-script into cfdisk if there is no partition table on the device or when you start cfdisk with
	      the --zero command-line option.

       W      Write the partition table to disk (you must enter an uppercase W).  Since this might destroy data on the disk, you must either  con-
	      firm  or	deny the write by entering `yes' or `no'.  If you enter `yes', cfdisk will write the partition table to disk and then tell
	      the kernel to re-read the partition table from the disk.

	      The re-reading of the partition table does not always work.  In such a case you need to inform the kernel about any  new	partitions
	      by using partprobe(8) or partx(8), or by rebooting the system.

       x      Toggle extra information about a partition.

       Up Arrow, Down Arrow
	      Move  the cursor to the previous or next partition.  If there are more partitions than can be displayed on a screen, you can display
	      the next (previous) set of partitions by moving down (up) at the last (first) partition displayed on the screen.

       Left Arrow, Right Arrow
	      Select the preceding or the next menu item.  Hitting Enter will execute the currently selected item.

       All commands can be entered with either uppercase or lowercase letters (except for Write).  When in a submenu or at a prompt, you  can  hit
       the Esc key to return to the main menu.

COLORS
       Implicit coloring can be disabled by creating the empty file /etc/terminal-colors.d/cfdisk.disable.

       See terminal-colors.d(5) for more details about colorization configuration.

       cfdisk does not support color customization with a color-scheme file.

ENVIRONMENT
       CFDISK_DEBUG=all
	      enables cfdisk debug output.

       LIBFDISK_DEBUG=all
	      enables libfdisk debug output.

       LIBBLKID_DEBUG=all
	      enables libblkid debug output.

       LIBSMARTCOLS_DEBUG=all
	      enables libsmartcols debug output.

       LIBSMARTCOLS_DEBUG_PADDING=on
	      use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.

SEE ALSO
       fdisk(8), parted(8), partprobe(8), partx(8), sfdisk(8)

AUTHOR
       Karel Zak <kzak@redhat.com>

       The current cfdisk implementation is based on the original cfdisk from Kevin E. Martin (martin@cs.unc.edu).

AVAILABILITY
       The cfdisk command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/.

util-linux							    March 2014								 CFDISK(8)
All times are GMT -4. The time now is 08:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy