10-22-2015
Quote:
Originally Posted by
zionassedo
... ... ...
On Digital VMS system, we used to redefine the SYS$OUTPUT environment variable, why cant I do the same here ?
Because in UNIX and Linux shells,
SYS$OUTPUT is not an environment variable; it is the string
SYS concatenated with the contents of the environment variable
OUTPUT. Most UNIX and Linux shells redirect input and output streams using redirections on the command line.
If you'd like to port a Digital VMS system shell to Solaris and, then you can use the
SYS$OUTPUT environment variable to redirect output when you invoke programs from that shell.
It is just like not being able to use IBM mainframe JCL commands to run most programs on UNIX and Linux systems (the
dd utility being an obvious exception).
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I redirect and append stdout and stderr to a file when using cron? Here is my crontab file:
*/5 * * * * /dir/php /dir/process_fns.php >>& /dir/dump.txt
Cron gives me an 'unexpected character found in line' when trying to add my crontab file.
Regards,
Zach Curtis
POPULUS (8 Replies)
Discussion started by: zcurtis
8 Replies
2. Shell Programming and Scripting
#!/usr/bin/perl
open(STDOUT, ">>$Textfile")
open(STDERR, ">>$Textfile")
print "program running\n";
$final = join("+", $initial,$final) #5
close (STDOUT);
close (STDERR);Hi all, above is my perl code. Notice i have captured the stdout and stderr to the same textfile. my code is expected to... (1 Reply)
Discussion started by: new2ss
1 Replies
3. Solaris
I've got a c++ program that works fine on Linux, compiles on Solaris fine with g++, but will not write to a fstream correctly in a class object.
And I've run into numerous other bugs in the disk management.
Jon (4 Replies)
Discussion started by: Joncamp
4 Replies
4. Shell Programming and Scripting
I have been doing this:
make xyz &> xyz.log &; tail -f xyz.log
The problem with this is that you never can ge sure when "make xyz" is done.
How can I pipe both stderr and stdout into tee so both stderr and stdout are copied both to the display and to the log file?
Thanks,
Siegfried (3 Replies)
Discussion started by: siegfried
3 Replies
5. Shell Programming and Scripting
working on a c sell script
I think I understand the concept of it, which is:
filename >> file.txt (to appaend)
or filename | tee -a file.txt (to append)
The problem is that my shell script is used with several parameters, and these commands don't seem to work with just filename. They... (2 Replies)
Discussion started by: mistermojo
2 Replies
6. Red Hat
Hi all. I am trying to use backticks in Perl to put STDERR into a string. The code is...
$readkey_test = `perl -MTerm::ReadKey -e 1`;
print $readkey_test;
if ($readkey_test =~ m/]/)
{
print "ReadKey not installed...\n";
}
else
{
print "ReadKey installed...\n";
}
If it comes up... (3 Replies)
Discussion started by: austinharris43
3 Replies
7. Shell Programming and Scripting
Can somebody explain to me why the diff output is not going to stderr?
Yet when I issue a diff from the command line the return code is -ne 1.
I am guessing diff always writes to stdout???
Is there away I can force the difff to write to stderr USING THE CURRENT
template. If possible, I... (5 Replies)
Discussion started by: BeefStu
5 Replies
8. Shell Programming and Scripting
Hi all,
can someone help me with the next redirection?
i want to redirect the stdout+stderr of a command to the same file (this i can do by prog &> file)
but in addition i want to redirect only the stderr to a different file.
how can i do this please? (in BASH)
thanks. (4 Replies)
Discussion started by: eee
4 Replies
9. Shell Programming and Scripting
Hello,
As stated in the title, I do some hacked parallel processing by running multiple instances of bash scripts, each in their own subshell. The code looks like this,
# launch one batch-train script in background for each value in fold group list
for FOLD_GROUP in "${FOLD_GROUP_LIST}"
do
... (5 Replies)
Discussion started by: LMHmedchem
5 Replies
10. Programming
(Apologies for any typos.)
OSX 10.12.3 AND Windows 10.
This is for the serious Python experts on at least 3.5.x and above...
In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly.
Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies
LEARN ABOUT DEBIAN
dntask
DNTASK(1) General Commands Manual DNTASK(1)
NAME
dntask - Execute VMS command procedures
SYNOPSIS
dntask [options] command-procedure
Options:
[-biVh] [-t timeout]
DESCRIPTION
dntask runs command procedures on a remote VMS system.
It takes advantage of the ability of the TASK object in DECnet to execute an arbitrary command procedure located in the users' login direc-
tory. The remote command procedure should output to SYS$NET rather than SYS$OUTPUT and (if interactive) read it's input also from SYS$NET.
The VMS equivalent of the (non-interactive version) command would be
TYPE node::"TASK=command-procedure"
For some example command procedures see the tasks directory of the source distribution. show_system.com is a non-interactive task that
simply displays the output of the VMS "SHOW SYSTEM" command on standard output. interactive.com is an interactive task that allows you to
enter DCL commands to be executed on the host VMS system. Be careful which commands you enter because they will expect input to come from
the network connection, for instance programs that do screen orientated input or output will almost certainly not work.
Task names can be up to 16 characters in length because that's the limit on DECnet object names.
OPTIONS
-b Send the output in binary mode. By default the output from the DECnet task is assumed to be records. This option sends the data "as
is" so you can put commands like BACKUP in the task and backup to your Linux box.
-i Interact with the command procedure. The command procedure must be written to be interactive by reading from and writing to SYS$NET.
Specifying -i for a non-interactive command procedure will cause dntask to time-out waiting for input. Not specifying -i for an
interactive command procedure will cause it to exit prematurely at the VMS end.
-t timeout
Specifies the timeout in seconds for interactive command procedures. If no input has been received from either standard input or the
VMS end in this time then dntask will exit. The default is 60 seconds. If the value 0 is given then dntask will wait forever (or
until you kill it).
-T connect timeout
Specifies the maximum amount of time the command will wait to establish a connection with the remote node. a 0 here will cause it to
wait forever. The default is 60 seconds
-h -? Displays help for using the command.
-V Show the version of the tools package that dntask comes from.
NOTES
The command procedure that you write MUST ALWAYS write something to SYS$NET or you will get a "connection refused" message. This is a limi-
tation with DECnet objects.
eg. If you write a task to start a remote DECterm it would look something like this:
$ remnode=f$element(0, ":", "''f$trnlnm("sys$rem_node")'")
$ set display/create/node='remnode'
$ create/term/detach
$ def/nolog sys$output sys$net
$ write sys$output "DECterm started on ''remnode'"
$ exit
The "write" command near the end is essential.
EXAMPLES
dntask 'myvax::show_system'
dndir -i 'tramp"christine pjc123"::interactive'
dndir -i 'tramp"christine -"::interactive'
Specifying "-" in the password field will prompt for the password.
SEE ALSO
dntype(1), dndir(1), dncopy(1), dndel(1)
DECnet utilities September 25 1998 DNTASK(1)