You see many strange and redundant things in copied shell scripts, many of which do worse than nothing. People fiddle until it 'works' without really knowing the language.
This does literally nothing, but at least seems harmless.
Given the 3 line shell script fragment:
we can't say that it does nothing. If the || : is omitted, the exit status of the remaining command line will be non-zero (failed) if db and i don't expand to identical strings. With it present, the exit status of this command line will always be zero (succeeded).
If the next line of code checks the exit status of this line of code (which I agree would be convoluted logic), then the results could change significantly.
Maybe the || : was put in to temporarily disable an error check in the following code, and wasn't removed when testing was completed. (I know this is still unlikely since it looks like skipdb could be used to test for this, but we don't see that skipdb is changed to a value other than 1 for subsequent times though the for loop once it gets set here.)
Probably a simple one.
Basically I am retrieving a number from a file - setting a variable against it and then incrementing this by 1 and using this as an entry number in a log file for messages. I need the variable to re-evalute itself each time I call it so I get the latest number in the file -... (1 Reply)
Hi,
Could someone please help me with how to do the following?
Say I have a flat file test.lst and the content of the file is:
Report Date - `date '+%m%d%Y'`
I'm trying the following
while read myLine
do
echo ${myLine}
done<test.lst
This prints Report Date - `date... (1 Reply)
I have variables:
FOO="Text"
BAR="FOO"
I'd like to be able to evaluate the variable named as the value of $BAR.
echo $FOO
Text
echo $BAR
FOO
This is what I'd like to do:
echo ${$BAR} (this won't work)
Text (3 Replies)
Let's say for example that we have two different ways was can code the exact same program to achieve the same result.
What is the best way to determine which of the two methods is the best solution?
Is it as simple as basing it on how long the program takes to run or is there a more... (4 Replies)
Hi all,
I have a script that runs perfectly from cmd, but in the cron it gives a strange ':::::::::::::::' output instead of evaluating the part inside the quotes.
this is the script:
bash-3.00# more test
#!/bin/ksh
#-----swap---
TEMP_FILE=/HealthCheck/test/file.txt
swap -s | tee... (1 Reply)
How to evaluate the value of a variable ?
For example:
a=var
$a=value !!!error happens!!!
I want to evaluate var=value, how to realize it?
Thanks!
---------- Post updated at 03:37 AM ---------- Previous update was at 02:22 AM ----------
I am using linux bash.
a=var
$a=value... (4 Replies)
Hi,
I am trying to set a variable that has time the format desired. And my intention is to echo variable (instead of actual date command) everytime I like to echo date. Please take a look at below code.
$NOW=''
echo $NOW
After 5 minutes
$echo $NOW
Issue here is , I am not... (2 Replies)
I want to create a conditional expression string and pass in an awk script. My script is as below...
comm="\$3 == "hello""
awk -F "^T" -v command="${comm}" ' {
if ( command ) { print "hye" }
}' testBut the statement "if ( command )" always evaluates to true which is not... (5 Replies)
I have to display only those subscribers which are in "unconnected state" and the date is 90 days older than today's date.
Below command is used for this purpose:
cat vfsubscriber_20170817.csv | sed -e 's/^"//' -e '1d' | \
nawk -F '",' '{if ( (substr($11,2,4) == 2017) && ( substr($11,2,8)... (1 Reply)
Discussion started by: dia
1 Replies
LEARN ABOUT SUNOS
scrl
scrl(3XCURSES) X/Open Curses Library Functions scrl(3XCURSES)NAME
scrl, scroll, wscrl - scroll a window
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
int scrl(int n);
int scroll(WINDOW *win);
int wscrl(WINDOW *win, int n);
PARAMETERS
n number and direction of lines to scroll
win pointer to the window in which to scroll
DESCRIPTION
The scroll() function scrolls the window win up one line. The current cursor position is not changed.
The scrl() and wscrl() functions scroll the window stdscr or win up or down n lines, where n is a positive (scroll up) or negative (scroll
down) integer.
The scrollok(3XCURSES) function must be enabled for these functions to work.
RETURN VALUES
On success, these functions return OK. Otherwise, they return ERR.
ERRORS
None.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO clearok(3XCURSES), libcurses(3XCURSES), attributes(5), standards(5)SunOS 5.10 5 Jun 2002 scrl(3XCURSES)