07-04-2013
man bash:
Quote:
Redirecting Standard Output and Standard Error
This construct allows both the standard output (file descriptor 1) and the standard error output (file descriptor 2) to be redi‐
rected to the file whose name is the expansion of word.
There are two formats for redirecting standard output and standard error:
&>word
and
>&word
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
how to make a line BLINKING in output and also how to increase font size in output
suppose in run a.sh script
inside echo "hello world "
i want that this should blink in the output and also
the font size of hello world should be big ..
could you please help me out in this (3 Replies)
Discussion started by: mail2sant
3 Replies
2. Shell Programming and Scripting
I have an xml file.
I am doing some change, say deleting line 770. File name is file.xml. I use:
sed '770d' file.xml
but this does not actually make changes in the *file* but shows the changes on standard output (screen)
if i use
$var=`sed '770d' file.xml`
echo $var > file.xml
this... (3 Replies)
Discussion started by: indianjassi
3 Replies
3. UNIX for Dummies Questions & Answers
I'm running the following rsync command to sync a directory between the 2 servers:
rsync -az --delete --stats /some_dir/ server_name:/some_dir
I'm getting the following output:
Number of files: 655174
Number of files transferred: 14221
Total file size: 1138531979331 bytes
Total... (0 Replies)
Discussion started by: GKnight
0 Replies
4. Solaris
I attached a README file that I will refer to.
I successfully completed everything in the README file until step 4.
# pwd
/gani/gani-2.4.4
# ls
COPYING Makefile.macros gem.c
Makefile Makefile.sparc_gcc gem.h
Makefile.amd64_gcc ... (1 Reply)
Discussion started by: Bradj47
1 Replies
5. UNIX for Dummies Questions & Answers
Hello,
I have a cronjob that i am currently running which is as follows:
php /home/****/cronjob.php --debug 2>&1 >> /home/cronjoboutput.txt
That, as you may know, logs the output to a file called cronjoboutput.txt in the home directory.
I want that cronjob to output to a different file... (6 Replies)
Discussion started by: umarsa
6 Replies
6. Shell Programming and Scripting
Hi there, just wondered if somebody could help me with a problem I have
I have a program that when run from the command line will output a list of objects
# list_servers
server1
server5
server7
server8
#
I just wanted to know, in perl, how can i make each line of output from... (4 Replies)
Discussion started by: rethink
4 Replies
7. Shell Programming and Scripting
Hi,
I am unable to get this script to work as desired. Basically, if an argument "log" is sent into the script, it outputs the result of the Make to a file output.log. However, if the argument is not passed, I want the output to be just put on screen (no redirection). See code snippet below.
#... (3 Replies)
Discussion started by: srujan45
3 Replies
8. UNIX for Advanced & Expert Users
Can someone explain the correlation between how sar names the disk drives and how the rest of the OS names the disk drives?
sar lists my disk drives as sd0, sd1, sd2, etc.....
while format lists my disk drives as c1t0d0, c1t1d0, c1t2d0,etc...
And also why sar shows 8 disks but format... (2 Replies)
Discussion started by: s ladd
2 Replies
9. Red Hat
Hello,
1 ) Fdisk -l # Displays all the disk with partition table information
My Query )
A ) How can i make one disk ex: /dev/sdd not visible in fdisk -l output ?
B) From where fdisk -l collect and display the information ? (8 Replies)
Discussion started by: saurabh84g
8 Replies
10. UNIX for Beginners Questions & Answers
Hi
I write below script to show if expected file exist in /etc/library/ , print success else failed. But it will print full path I just need to print module name in output. And if it possible show time that spent to compile each module.
FYI 1: First run another script just go to the paths... (1 Reply)
Discussion started by: indeed_1
1 Replies
WC(1) BSD General Commands Manual WC(1)
NAME
wc -- word, line, and byte count
SYNOPSIS
wc [-c | -m] [-Llw] [file ...]
DESCRIPTION
The wc utility displays the number of lines, words, bytes and characters contained in each input file (or standard input, by default) to the
standard output. A line is defined as a string of characters delimited by a <newline> character, and a word is defined as a string of char-
acters delimited by white space characters. White space characters are the set of characters for which the iswspace(3) function returns
true. If more than one input file is specified, a line of cumulative counts for all the files is displayed on a separate line after the out-
put for the last file.
The following options are available:
-c The number of bytes in each input file is written to the standard output.
-L The number of characters in the longest line of each input file is written to the standard output.
-l The number of lines in each input file is written to the standard output.
-m The number of characters in each input file is written to the standard output.
-w The number of words in each input file is written to the standard output.
When an option is specified, wc only reports the information requested by that option. The default action is equivalent to all the flags
-clw having been specified.
The following operands are available:
file A pathname of an input file.
If no file names are specified, the standard input is used and no file name is displayed.
By default, the standard output contains a line for each input file of the form:
lines words bytes file_name
EXIT STATUS
The wc utility exits 0 on success, and >0 if an error occurs.
SEE ALSO
iswspace(3)
COMPATIBILITY
Historically, the wc utility was documented to define a word as a ``maximal string of characters delimited by <space>, <tab> or <newline>
characters''. The implementation, however, didn't handle non-printing characters correctly so that `` ^D^E '' counted as 6 spaces, while
``foo^D^Ebar'' counted as 8 characters. 4BSD systems after 4.3BSD modified the implementation to be consistent with the documentation. This
implementation defines a ``word'' in terms of the iswspace(3) function, as required by IEEE Std 1003.2 (``POSIX.2'').
The -L option is a non-standard extension, compatible with the -L option of the GNU and FreeBSD wc utilities.
STANDARDS
The wc utility conforms to IEEE Std 1003.2-1992 (``POSIX.2'').
BSD
February 18, 2010 BSD