11-09-2009
Scottn, Thank you very much for the help!
I had tried the [] but was switching things around because i couldn't figure out why things were breaking. After your confirmation on the brackets and the script sample below. I realized i had no spaces after the [] brackets or parrens. I write vb scripts so these spacing issues in unix are new to me - but i'm not likely to forget the lesson!
Bakunin, Thank you for all the additional insghts and help. With the two responses i was able to get it to work an write it better!!!!!
Last edited by KME; 11-09-2009 at 10:39 AM..
Reason: update
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I cannot seem to pass the value of the variable assigned in the "else" statment below to an "if" statement outside of the loop. When I debug using "set -x", I find that the value of "$A" is empty. Is there something I'm missing here? Code is below:
do
if ] then
echo "Good Match"... (2 Replies)
Discussion started by: douknownam
2 Replies
2. Shell Programming and Scripting
Hi,
I have a strange problem and I'm sure its because I'm doing something stupid.
When I loop through all of the files in a directory they cannot be found.
Any help would be greatly appreciated.
Thanks,
-E
$ touch a.txt
$ touch b.txt
$ ls
a.txt b.txt
$ for f in `ls` ; do... (3 Replies)
Discussion started by: earls
3 Replies
3. Shell Programming and Scripting
can anyone please help me with this:
i have written a shell script and a stored procedure which has one OUT parameter. now i want to use that out parameter as an input to the unix script but i am getting an error as variable not found. below are the unix scripts and stored procedure...
... (4 Replies)
Discussion started by: swap21783
4 Replies
4. Shell Programming and Scripting
can any1 please tell me what is problem with following code:
i=1;
cat test| while read CMD;
do
Var$i=$CMD; or Var$i=$(echo $CMD) ;
let i++
doneI keep getting error :
line 4: Var1=sometext: command not found (2 Replies)
Discussion started by: kashif.live
2 Replies
5. Shell Programming and Scripting
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies
6. UNIX for Dummies Questions & Answers
Hi, I get a "FILEPATH: not found" error on the 3rd line and the line where it is within the case. Any idea as to why I'm getting this error time and time again?
Oh and FILEPATH will store the directory of the file.
I appreciate any help!
IAM=`basename $0`
RC=0
FILEPATH = ""... (1 Reply)
Discussion started by: MIA651
1 Replies
7. Shell Programming and Scripting
The code at the bottom is a simplified example of what we have.
If I use the following:
&& echo "echo failed"
$? returns 1
When I use
if ; then echo "echo failed" ; fi
$? returns 0
Does anyone know what's wrong with this?
Using AIX 6.1 and KSH
for NUM in 1 2 3
do
... (5 Replies)
Discussion started by: jfxdavies
5 Replies
8. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
9. Shell Programming and Scripting
I am unable to use the value of a variable.
while ]
do
LstFldDataPart =`head -n "$LstFldDataPartCntr" "${FeedFileDir}/${FeedFileBadRecs}" | tail -1 | tr -d '\n'`
echo $LstFldDataPart
JndLstFldDataPart="${JndLstFldDataPart}${LstFldDataPart}"
LstFldDataPartCntr=... (3 Replies)
Discussion started by: TomG
3 Replies
10. Shell Programming and Scripting
Script name is test.ksh
I know that that the ssh command is working properly, this can be verified by the value returned in respond variable. It is unique to the remote server
_____________________________________________________
respond=$(ssh $remoteHost find... (3 Replies)
Discussion started by: Adagio
3 Replies
LEARN ABOUT X11R4
upsd.users
UPSD.USERS(5) NUT Manual UPSD.USERS(5)
NAME
upsd.users - Administrative user definitions for NUT upsd
DESCRIPTION
Administrative commands such as setting variables and the instant commands are powerful, and access to them needs to be restricted. This
file defines who may access them, and what is available.
Each user gets its own section. The fields in that section set the parameters associated with that user's privileges. The section begins
with the name of the user in brackets, and continues until the next user name in brackets or EOF. These users are independent of
/etc/passwd.
Here are some examples to get you started:
[admin]
password = mypass
actions = set
actions = fsd
instcmds = all
[pfy]
password = duh
instcmds = test.panel.start
instcmds = test.panel.stop
[monmaster]
password = blah
upsmon master
[monslave]
password = abcd
upsmon slave
FIELDS
password
Set the password for this user.
actions
Allow the user to do certain things with upsd. To specify multiple actions, use multiple instances of the actions field. Valid actions
are:
SET
change the value of certain variables in the UPS
FSD
set the forced shutdown flag in the UPS. This is equivalent to an "on battery + low battery" situation for the purposes of
monitoring.
The list of actions is expected to grow in the future.
instcmds
Let a user initiate specific instant commands. Use "ALL" to grant all commands automatically. To specify multiple commands, use
multiple instances of the instcmds field. For the full list of what your UPS supports, use "upscmd -l".
The cmdvartab file supplied with the distribution contains a list of most of the known command names.
upsmon
Add the necessary actions for a upsmon process to work. This is either set to "master" or "slave".
Do not attempt to assign actions to upsmon by hand, as you may miss something important. This method of designating a "upsmon user" was
created so internal capabilities could be changed later on without breaking existing installations.
SEE ALSO
upsd(8), upsd.conf(5)
INTERNET RESOURCES
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
Network UPS Tools 05/25/2012 UPSD.USERS(5)