Sponsored Content
Full Discussion: Supress error message
Top Forums UNIX for Advanced & Expert Users Supress error message Post 302154562 by cybotic on Monday 31st of December 2007 06:31:58 AM
Old 12-31-2007
> /dev/null 2>&1

try sticking this at the end of the cmd:
> /dev/null 2>&1


so in your case it might be something like:

ls -lrt $DIR/* | wc -l > /dev/null 2>&1
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Supress screen output...

I need to suppress the output to the screen. I am appending to a file so do not need the output on the screen in the CLI environment. eg. cat $HOME/somefile >> $HOME/anotherfile I am doing this a number of times with SQL output files so I can look at the finished file not on the screen in the... (3 Replies)
Discussion started by: jagannatha
3 Replies

2. UNIX for Advanced & Expert Users

How to supress a "Killed" message when a process is terminated?

Does anyone know how I can supress the "Killed" message that's produced when I kill a process? I've got a script that performs a "tail -f" on a database error log and pipes the output into an awk script which looks for certain error messages and forwards any that qualify to my pager. The problem... (2 Replies)
Discussion started by: kenwolff
2 Replies

3. UNIX for Advanced & Expert Users

Supress special chars in vi

Hi, One of our application is producing log files. But if we open the log file in vi or less or view mode, it shows all the special characters in it. The 'cat' shows correctly but it shows only last page. If I do 'cat' <file_name> | more, then again it shows special characters. ... (1 Reply)
Discussion started by: divakarp
1 Replies

4. Shell Programming and Scripting

how to supress the trace

Hi I am working in ksh and getting the trace after trying to remove the file which in some cases does not exist: $ my_script loadfirm.dta.master: No such file or directory The code inside the script which produces this trace is the following: ] || rm ${FILE}.master >> /dev/null for... (3 Replies)
Discussion started by: aoussenko
3 Replies

5. Shell Programming and Scripting

supress error messages

Hi I have a script which connects to oracle using sqlplus if ! check_sqlplus "$ORACLE_SID" ; then echo "Unable to use sqlplus for sid $ORACLE_SID" return 1 else echo "attempting to connect to database" echo $ORACLE_HOME echo $ORACLE_SID echo "Status before entering... (2 Replies)
Discussion started by: xiamin
2 Replies

6. Shell Programming and Scripting

AWk - supress warning

Hi, I am trying to run a script using awk and sed a few times. The script itself seems to work fine but in a final awk statement it throws up a warning: awk: warning: escape sequence `\.' treated as plain `.' script: ... (3 Replies)
Discussion started by: HugoDarley
3 Replies

7. Shell Programming and Scripting

To Supress *

Hi Team , I want supress the meaning of * while passing it as parameter. I have file which contains file format and destination directory. let say abc* |/home/xyz I had function which will read these values and pass it to another function. Code looks like below func1 () {... (6 Replies)
Discussion started by: gvkumar25
6 Replies

8. Shell Programming and Scripting

Supress text

Hi, I was looking for a simple code to suppress the text between 2 characters. the characters can be of same kind like "*" or "(" and ")". The number of characters are not consistent and could vary. How can I suppress the text between 2 characters? Example: Input : Hello (Within Bracket)... (8 Replies)
Discussion started by: ahmedwaseem2000
8 Replies

9. Shell Programming and Scripting

awk to supress error message with custom text

After a bash function is run the below file is produced: out_name.txt tab-delimeted Input Errors and warnings AccNo Genesymbol Variant Reference Sequence Start Descr. Coding DNA Descr. Protein Descr. GeneSymbol Coding DNA Descr. GeneSymbol Protein Descr. Genomic... (3 Replies)
Discussion started by: cmccabe
3 Replies

10. Shell Programming and Scripting

Supress java error output to shell

Hello, I know this isn't exactly a shell script question but I'm not sure where else to post it. I am running a java program out of a shell script. There are times when I get an error like, "java.lang.ArrayIndexOutOfBoundsException: 22 at blah, blah at blah, blah ... (3 Replies)
Discussion started by: LMHmedchem
3 Replies
TEMPFILE(1)						      General Commands Manual						       TEMPFILE(1)

NAME
tempfile - create a temporary file in a safe manner SYNOPSIS
tempfile [-d DIR] [-p STRING] [-s STRING] [-m MODE] [-n FILE] [--directory=DIR] [--prefix=STRING] [--suffix=STRING] [--mode=MODE] [--name=FILE] [--help] [--version] DESCRIPTION
tempfile creates a temporary file in a safe manner. It uses tempnam(3) to choose the name and opens it with O_RDWR | O_CREAT | O_EXCL. The filename is printed on standard output. See tempnam(3) for the actual steps involved in directory selection. The directory in which to create the file might be searched for in this order (but refer to tempnam(3) for authoritative answers): a) In case the environment variable TMPDIR exists and contains the name of an appropriate directory, that is used. b) Otherwise, if the --directory argument is specified and appropriate, it is used. c) Otherwise, P_tmpdir (as defined in <stdio.h>) is used when appropriate. d) Finally an implementation-defined directory (/tmp) may be used. OPTIONS
-d, --directory DIR Place the file in DIR. -m, --mode MODE Open the file with MODE instead of 0600. -n, --name FILE Use FILE for the name instead of tempnam(3). The options -d, -p, and -s are ignored if this option is given. -p, --prefix STRING Use up to five letters of STRING to generate the name. -s, --suffix STRING Generate the file with STRING as the suffix. --help Print a usage message on standard output and exit successfully. --version Print version information on standard output and exit successfully. RETURN VALUES
An exit status of 0 means the temporary file was created successfully. Any other exit status indicates an error. BUGS
Exclusive creation is not guaranteed when creating files on NFS partitions. tempfile cannot make temporary directories. tempfile is dep- recated; you should use mktemp(1) instead. EXAMPLE
#!/bin/sh #[...] t=$(tempfile) || exit trap "rm -f -- '$t'" EXIT #[...] rm -f -- "$t" trap - EXIT exit SEE ALSO
tempnam(3), mktemp(1) Debian 27 Jun 2012 TEMPFILE(1)
All times are GMT -4. The time now is 07:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy