Hi,
I wrote a script to get the oldest file from a directory path (which is passed as a parameter to the script)
#########################################################
XMLFILE_PATH={$1}
cd $XMLFILE_PATH
JPM_FILENAME = `(ls -tr User* | head -1)`
#echo $JPM_FILENAME
###### END... (1 Reply)
I'm sure this is a simple thing but I can't figure it out. In a script that I'm writing, I'd like to be able to store each line of output from "ls -l" into a variable. Ultimately I'd like to end up with something like:
for a in `ls -l`
do something with $a
doneBut that's reading each... (2 Replies)
Hi,
I work in ksh88.
I have an interective script which prompts the user for the input and returns numeric value depending on the input provided. I need to call this script inside another script and then assign the resulting output the the variable.
The call like that A=`my script` obviously... (6 Replies)
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Hi guys
I am calling one DB2 stored proc through unix. It is giving me below output. I want to capture the value 150 in one UNIX variable in shell script. Please let me know how I can achieve this. Thanks in advance
Value of output parameters
--------------------------
Parameter Name :... (5 Replies)
I'm tring to write down a simple script that would execute a command and wait until it returns a specific result.
This is what i did:
bjobs_out=`bjobs`
while ]; do
bjobs_out=`bjobs`
sleep 6
done
It seems to work until the command 'jobs' return the list of jobs in execution, but... (4 Replies)
I'm running a matlab code within a shell script. This is how I do it,
matlab -nodesktop -nosplash -nojvm -r "my_program;quit"
This works fine. My matlab code prints out a single number, say "ans = 10" for example. I want to assign this to a variable in the shell script.
I tried doing this... (18 Replies)
Hi there is there a way to assing variable a value that is output of a program in awk script. For e.g., I did
temp=(`grep "" $5 | cut -f8 -d' '`)
but it does not work.
Any advice???
Thanks in advance!!! :) (3 Replies)
Hi- I am returning output of an query into a array variable in my shell script.
set -A DATE_RANGE `sqlplus -s **/**@** << EOF
set termout off
set echo off
set serveroutput off
set pagesize 0
set linesize 500
set heading off
set verify off
set feedback off
select... (1 Reply)
I'm trying to copy script output and use it in this same script as a variable, and call the variable when script is compiled.
The script is below.
#!/bin/bash
output=$(script)
while read line; do
if ];
then
grep "$line" logfile.txt
# Create text file
echo "From: IT ... (4 Replies)
Discussion started by: SysAdminRialto
4 Replies
LEARN ABOUT X11R4
upslog
UPSLOG(8) NUT Manual UPSLOG(8)NAME
upslog - UPS status logger
SYNOPSIS
upslog -h
upslog [OPTIONS]
DESCRIPTION
upslog is a daemon that will poll a UPS at periodic intervals, fetch the variables that interest you, format them, and write them to a
file.
The default format string includes variables that are supported by many common UPS models. See the description below to make your own.
OPTIONS -h
Display the help message.
-f format
Monitor the UPS using this format string. Be sure to enclose format in quotes so your shell doesn't split it up. Valid escapes within
this string are:
%%
Insert a single "%"
%TIME format%
Insert the time with strftime formatting
%ETIME%
Insert the number of seconds, ala time_t. This is now a 10 digit number.
%HOST%
insert the local hostname
%UPSHOST%
insert the host of the UPS being monitored
%PID%
insert the pid of upslog
%VAR varname%
insert the value of variable varname
The default format string is:
%TIME @Y@m@d @H@M@S% %VAR battery.charge% %VAR input.voltage%
%VAR ups.load% [%VAR ups.status%] %VAR ups.temperature%
%VAR input.frequency%
-i interval
Wait this many seconds between polls. This defaults to 30 seconds.
If you require tighter timing, you should write your own logger using the upsclient(3) library.
-l logfile
Store the results in this file.
You can use "-" for stdout, but upslog will remain in the foreground.
-s ups
Monitor this UPS. The format for this option is upsname[@hostname[:port]]. The default hostname is "localhost".
-u username
If started as root, upsmon will setuid(2) to the user id associated with username for security.
If username is not defined, it will use the value that was compiled into the program. This defaults to "nobody", which is less than
ideal.
SERVICE DELAYS
The interval value is merely the number given to sleep(3) after running through the format string. Therefore, a query will actually take
slightly longer than the interval, depending on the speed of your system.
LOG ROTATION
upslog writes its PID to upslog.pid, and will reopen the log file if you send it a SIGHUP. This allows it to keep running when the log is
rotated by an external program.
SEE ALSO
Server:
upsd(8)
Clients:
upsc(8), upscmd(8), upsrw(8), upsmon(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
Network UPS Tools 05/21/2012 UPSLOG(8)