Funky behavior that im noticing


 
Thread Tools Search this Thread
Operating Systems Solaris Funky behavior that im noticing
# 1  
Old 09-16-2006
Funky behavior that im noticing

I was just messing around on my test system,
Is sending a file to the /dev/null i.e. mv testfile /dev/null
is this the same as erasing the file, because I've been noticing some weird behavior since I did this. like the following when i execute commands...

sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
sh: /dev/null: cannot create
# 2  
Old 09-16-2006
Uh, nope. Your command mv testfile /dev/null copied testfile OVER /dev/null. I'm not sure what effect that would have as I've never done it, but it can't be good . . . .

/dev/null is a system device which is "nothing". I'm not thinking of an easy way to explain it. Basically it is an empty file that always stays empty. You use it to throw away output from a script by redirecting the output (error messages, etc.) to /dev/null for example. By replacing it with your testfile that system device is now screwed up.

I imagine you're wondering what to do to fix it. Unfortunately I don't know.
# 3  
Old 09-16-2006
First, do an 'ls -ld /dev/null' to see if /dev/null exists, is corrupt, whatever. It should look like this:
Code:
crw-rw-rw-  1 root root 1, 3 Sep  9 18:12 /dev/null

If it does not look like this, or have these permissions, make a new /dev/null by using the "mknod" command (as root):
Code:
mknod /dev/null c 1 3

Don't forget to set the permissions to 666 to allow everyone to read and write from/to it.
# 4  
Old 09-17-2006
See this link from sysunconfig.net

http://sysunconfig.net/unixtips/solaris.html#null
# 5  
Old 09-21-2006
Lightbulb

Well guys, why here /dev/null is corrupted cant I use the command

# > /dev/null

Will that not work pls help..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Weird behavior of Vi

Hi there, I am a bit puzzled by a weird behavior of Vi. I very simply would like to add increased numbers in some files. Since I have many thousands entries per file and many files, I would like to macro it in vi. To do this, I enter the first number ("0001") on the first line and then yank... (4 Replies)
Discussion started by: hypsis
4 Replies

2. AIX

LUN Behavior

Aix 6.1, working with a nim master and nim_altmaster both LPARS have access to the same data LUN, /nimdisk I do realize the risks of having 2 servers access the same LUN, however it serves the purpose of being able to restore mksysb's to/from our DR site if necessary, at least in theory ;) ... (3 Replies)
Discussion started by: mshilling
3 Replies

3. HP-UX

Unusual Behavior?

Our comp-operator has come across a peculiar ‘feature'. We have this directory where we save all the reports that were generated for a particular department for only one calendar year. Currently there are 45,869 files. When the operator tried to backup that drive it started to print a flie-listing... (3 Replies)
Discussion started by: vslewis
3 Replies

4. Shell Programming and Scripting

carriage return or funky character stuck in my variables - help :)

My variables contain carriage returns... or something. Here is the line in my xml file of interest: <tmp>72</tmp> And here is the line that extracts the 72 from it: REAL=`grep '<tmp>' test.xml | sed -e 's/^ *<tmp>//' -e 's/<\/tmp>//' -re 's/(N|n|A|a|\/)/U/g'`If echo the variable it... (5 Replies)
Discussion started by: audiophile
5 Replies

5. Shell Programming and Scripting

sed behavior on hp-ux

the sed command: sed 's/^*//' file does not work on HP-UX :-( but it works fine on Linux, content of file: <tab><tab>hello output should be: hello Any ideas?? Thank you Andy (8 Replies)
Discussion started by: andy2000
8 Replies

6. HP-UX

ltoa Behavior

I am working with the following code: #include <stdlib.h> #include <string> #include <iostream> using std::cout; using std::endl; using std::flush; int main() { long lng1 = 123; long lng2 = 4567; cout<<ltoa(lng1)<<ltoa(lng2)<<endl<<flush; return 0; } Instead of receiving... (2 Replies)
Discussion started by: charitonca
2 Replies

7. Programming

Behavior of pthreads

Hi All, I ve written a small program to get started off with pthreads. I somehow feel the program doesnt meet the purpose. Please find the code and the output below. Please find my question at the bottom. #include <pthread.h> #include <stdio.h> #include <stdlib.h> void *PrintThread1(void... (4 Replies)
Discussion started by: nhrraj
4 Replies

8. Programming

ls behavior

I put this here because it is a 'behavior' type question.. I seem to remember doing ls .* and getting all the .-files, like .profile .login etc. But ls .* doesn't do that, it lsts the contents of every .*-type subdirectory. Is it supposed to? I should think that a -R should be given to... (10 Replies)
Discussion started by: AtleRamsli
10 Replies

9. UNIX for Dummies Questions & Answers

Telnet behavior

Hi there, I've an stupid question. If I make a telnet to a server from my computer and then execute a command that starts an application (on the server), when I disconnect, the application stops running, which is pretty obvious. Is it possible to add a flag at the end of the command so when I cut... (4 Replies)
Discussion started by: piltrafa
4 Replies
Login or Register to Ask a Question