I want to save the contents of a variable to a file. How can that be achieved?
I have tried with:
echo $varname > textfile.txt
but for some reason it does not print anything. (1 Reply)
Hi all,
I am displaying my result in HTML format using tables.
I want to save the results in file in the same format along with the table only.
How do i do that in perl?
I have attached the table structure .
I want to save like that itself .
with regards (2 Replies)
Does anybody know any alternative way to save output result of a program into another new file?
I got try the command below:
program_used input_file > new_output_file
program_used input_file >> new_output_file
Unfortunately, both the ">" and ">>" is not work at this case to save the output... (6 Replies)
Hi,
I have a 3rd party tool on Solaris 8. I am running it thorugh my script but I am not able to capture its output into a variable.
Like, I tried, but did not work.
output=`/usr/bin/myTool`
echo $output
Also, I tried saving in a file but when I run, output is always shown on the... (19 Replies)
Hi,
in shell script, i have the command swstart -p which returns an output. i want to store the output of this command into a variable. how i can do that
excerpt from the script
#!/usr/bin/ksh
#
#
#
# Program: swstart -p
#
# Description: Starts the sentinels on Slave server
... (4 Replies)
Hi,
If I type:
ls -l *txt | awk '{print $8}'
I get the file listing if I am in the directory.
If I try to do the same from a job flow, doing also other things, I can't do
ls -l directory/*txt | awk '{print $8}' > directory/result.txt
or
echo ls -l directory/*txt | awk '{print... (8 Replies)
i want to save the output of /scripts/whoowns domain.com to a username
like $user = /scripts/whoowns domain.com
but I'm not sure how to do that
This is inside a bash script
how can I get the output of /scripts/whoowns
then save that to a variable?
thanks!
---------- Post updated at... (0 Replies)
Currently I have a perl code to combine two different files.
#! /usr/bin/perl -w
use strict;
open FP1,"A.txt";
open FP2,"B.txt";
my ($l1,$l2);
while(1)
{
$l1=<FP1>; chomp $l1;
$l2=<FP2>; chomp $l2;
last unless(defined $l1 or defined $l2);
print "$l1 $l2\n";
}
close FP2;... (4 Replies)
My requirement is to read a column data from a file & save it in a variable for each row & process it. I am using the below code-
Leadlines="$TGTFILE/Error.txt">>$log_file
while read line
do
id = ` echo $line | cut -d "," -f1 `
email = ` echo $line | cut -d "," -f2 `
-----------
done
My... (2 Replies)
Discussion started by: saga20
2 Replies
LEARN ABOUT OPENDARWIN
tcl_restoreresult
Tcl_SaveResult(3) Tcl Library Procedures Tcl_SaveResult(3)__________________________________________________________________________________________________________________________________________________NAME
Tcl_SaveResult, Tcl_RestoreResult, Tcl_DiscardResult - save and restore an interpreter's result
SYNOPSIS
#include <tcl.h>
Tcl_SaveResult(interp, statePtr)
Tcl_RestoreResult(interp, statePtr)
Tcl_DiscardResult(statePtr)
ARGUMENTS
Tcl_Interp *interp (in) Interpreter for which state should be saved.
Tcl_SavedResult *statePtr (in) Pointer to location where interpreter result should be saved or restored.
_________________________________________________________________DESCRIPTION
These routines allows a C procedure to take a snapshot of the current interpreter result so that it can be restored after a call to
Tcl_Eval or some other routine that modifies the interpreter result. These routines are passed a pointer to a structure that is used to
store enough information to restore the interpreter result state. This structure can be allocated on the stack of the calling procedure.
These routines do not save the state of any error information in the interpreter (e.g. the errorCode or errorInfo variables).
Tcl_SaveResult moves the string and object results of interp into the location specified by statePtr. Tcl_SaveResult clears the result for
interp and leaves the result in its normal empty initialized state.
Tcl_RestoreResult moves the string and object results from statePtr back into interp. Any result or error that was already in the inter-
preter will be cleared. The statePtr is left in an uninitialized state and cannot be used until another call to Tcl_SaveResult.
Tcl_DiscardResult releases the saved interpreter state stored at statePtr. The state structure is left in an uninitialized state and can-
not be used until another call to Tcl_SaveResult.
Once Tcl_SaveResult is called to save the interpreter result, either Tcl_RestoreResult or Tcl_DiscardResult must be called to properly
clean up the memory associated with the saved state.
KEYWORDS
result, state, interp
Tcl 8.1 Tcl_SaveResult(3)