Questions tagged [dev-null]

On Unix-like systems, /dev/null is a device file that discards all data written to it but reports that the write operation succeeded.

On Unix-like systems, /dev/null is a device file that discards all data written to it but reports that the write operation succeeded. It is typically used for disposing of unwanted output streams of a process, or as a convenient empty file for input streams.

69 questions
0
votes
1 answer

PHP Cli, how to use redirection

I need to start php from cli and redirect stdout to /dev/null, but I'm using args and redirect don't work. php status.php Arg1 Arg2 > /dev/null 2>&1 How to fix that?
0
votes
0 answers

How to get subprocess default/preset values/behaviour

In this post I have explained how to check how many QGIS projects are open in a windows session. Here is the shortened code: import os import subprocess from os.path import basename from PyQt4.QtGui import QMessageBox def checkQgisProcesses(self): …
Stefan
  • 1,383
  • 2
  • 15
  • 25
0
votes
2 answers

Trouble with error handling in my first bash script

OK, so I am a total beginner with bash scripts and I am aware that the question is probably phrased a bit awkwardly, but I'll be as clear as I can! I have written the following script to create a backup of repositories in a folder. The script is as…
jamessct
  • 821
  • 3
  • 10
  • 15
0
votes
0 answers

Redirecting null make file unreadable

I am using solaris OS. the problem is when is redirect /dev/null to a "growing big log file", it becomes unreadable. Also it helps to decrease the file size to zero, but I can not open it with less command du to error that says it is "binary file,…
Sh0o
  • 11
  • 2
0
votes
1 answer

Android: send an onClick bash command to /dev/null

I made some buttons in my app that exec a bash cmd. Here is my string: final String[] test = {"su","-c","echo test > /system/test.txt"}; This cmd works, in fact, i can see the test.txt file on /system/ with the line test inside. My question…
iGio90
  • 290
  • 1
  • 4
  • 15
0
votes
1 answer

error when running call() in Python subprocess

i'm trying to run: try: with open(subprocess.PIPE, 'w') as pipe: call(["/usr/sbin/atms","-k"], stdout=pipe, stderr=pipe) …
Alon_T
  • 1,430
  • 4
  • 26
  • 47
0
votes
1 answer

Redirect output of process ran by execv

Possible Duplicate: redirecting output to a file in C I'm running a process as follows: char* [NUM]; char[0] = processName; char[1] = arg0; ... char[NUM] = 0; execv(args[0],args); The question is how I can make it redirect its output to…
Alon_T
  • 1,430
  • 4
  • 26
  • 47
-1
votes
1 answer

Portable check for library

A project I am trying to compile has this command: cc -xc++ -o/dev/null -lc++ -shared However I am using PowerShell, which has no notion of /dev/null: PS C:\> cc -xc++ -o/dev/null -lc++…
Zombo
  • 1
  • 62
  • 391
  • 407
-2
votes
1 answer

Redirect only stderr to /dev/null while redirecting stdout to a file (zsh)

I have a command cmd that I want to use in a zsh script in the form: cmd -opt val > info.txt but I want to redirect stderr from that one line to /dev/null. Evidently the following does not work: cmd -opt val > info.txt > /dev/null How to do…
murray
  • 737
  • 2
  • 10
  • 28
1 2 3 4
5