Sponsored Content
Top Forums Shell Programming and Scripting Error output of cat to /dev/null Post 302493930 by methyl on Friday 4th of February 2011 08:08:41 AM
Old 02-04-2011
Quote:
`cat /dirA/dirB/temp*.log > /dirA/dirB/final.log 2>/dev/null`$
`rm /dirA/dirB/temp*.log 2>/dev/null`$
Just for interest the $ sign (only) at the end of the line when viewed with "sed" tells me that this is a normal unix text file.

The problem with the script is the backticks. Not required in this context and will cause the error you are seeing. It will try to execute each file in the directory list and fail on the first one because it is not in $PATH !

Try this:
Code:
cat /dirA/dirB/temp*.log > /dirA/dirB/final.log 2>/dev/null
rm /dirA/dirB/temp*.log 2>/dev/null

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

error piping nohup to /dev/null

Hi, I have a script as follows: #!/bin/sh nohup ./my_program >& /dev/null & However, i get a "Generated or received a file descriptor number that is not valid" whenever I run it. running the command up in prompt is ok though. if i change the first line to #!/bin/csh i get a then:... (4 Replies)
Discussion started by: mochi
4 Replies

2. Solaris

URGENT - setup port and dump all output to /dev/null or a file

Please help urgently. I need to setup up some sort of service on a solaris server on a port. I dont need it do anything special, anything that is sent to this port from an external server should be dump to /dev/null or a flat file.. Can you help urgently? (1 Reply)
Discussion started by: frustrated1
1 Replies

3. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

4. UNIX for Dummies Questions & Answers

cat /dev/null

Hi, Excuse my ignorance here - I'm a networks man and my knowledge of all things unix is somewhat limited. We have a very large file (/var/tmp/mond.log) that we need to zero - does the "cat /dev/null > /var/tmp/mond.log" command achieve this? (4 Replies)
Discussion started by: freakydancer
4 Replies

5. UNIX for Dummies Questions & Answers

cp output /dev/null results in not a directory

Hello, I am working on a script to measure the read performance of a busybox environment. The logical choice is to use a command line like: (time cp * /dev/null) 2> /tmp/howlong.txt Ah, the rub is cp or /dev/null will only accept a single file at a time. The result in the txt file is and... (1 Reply)
Discussion started by: stevesmo
1 Replies

6. Ubuntu

tar not reading if output directed to /dev/null

I stumbled across a somewhat strange behavior of tar and find no explanation for it: i was testing a DVD for read errors and thought to simply tar the content and direct the output to /dev/null: tar -cvf - /my/mountpoint/*ts > /dev/null This way i expected the system to read the complete... (4 Replies)
Discussion started by: bakunin
4 Replies

7. UNIX for Dummies Questions & Answers

/dev/null 2>&1 Versus /dev/null 2>1

How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&" echo "hello" > /dev/null 2>&1 echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies

8. HP-UX

/dev/Null error

Hi Guru's, I am trying to test the network speed or load by this command. but getting error " Not Connected ". Could you guys please help. ftp> put "|dd if=/dev/zero bs=8k count=1000000" /dev/null Not connected. Please use code tags! (9 Replies)
Discussion started by: sris.sun
9 Replies

9. Shell Programming and Scripting

Redirecting standard out to /dev/null goes to file "/dev/null" instead

I apologize if this question has been answered else where or is too elementary. I ran across a KSH script (long unimportant story) that does this: if ; then CAS_SRC_LOG="/var/log/cas_src.log 2>&1" else CAS_SRC_LOG="/dev/null 2>&1" fithen does this: /usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies

10. Shell Programming and Scripting

redirect the audio output to /dev/null

I'm using an text-to-speech synthesis in a script, and I need to redirect it's output to /dev/null how can I do that ? And how to redirect the stream to his normal output then (sound card ) ? thankx (2 Replies)
Discussion started by: firelink
2 Replies
switchlog(8)						      System Manager's Manual						      switchlog(8)

NAME
switchlog - moves an AdvFS file domain transaction log SYNOPSIS
/sbin/advfs/switchlog domain_name vol_id OPERANDS
Specifies the name of an existing file domain. Specifies the number of the new volume to use for the log. DESCRIPTION
The switchlog command relocates the transaction log of the specified file domain to a different volume in the same file domain. Moving the transaction log within a multivolume file domain is typically done to place the log on either a faster, less congested, or mirrored volume. Use the showfdmn(8) command to determine the current location of the transaction log. In the showfdmn command display, the letter L dis- plays next to the volume that contains the log. The showfdmn command also displays all of the volumes and their volume numbers. RESTRICTIONS
You must be the root user to use this command. EXAMPLES
The following example displays the log's current location by using the showfdmn command and then moves it to volume 2 by using the switchlog command. # /sbin/showfdmn domain_eng Id Date Created LogPgs Version Domain Name 30bf7d8f.0000ec60 Fri Feb 1 17:11 1999 512 4 domain_eng Vol 512-Blks Free % Used Cmode Rblks Wblks Vol Name 1L 1160604 316688 73% on 128 128 /dev/vol/v_a 2 3577488 1495760 58% on 128 128 /dev/vol/v_b 3 1160604 305264 74% on 128 128 /dev/vol/v_c ---------- --------- ------ 5898696 2117712 64% # /sbin/advfs/switchlog domain_eng 2 FILES
Contains file domain names and devices. SEE ALSO
Commands: mkfdmn(8), showfdmn(8) Files: advfs(4) switchlog(8)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy