Always double check before you click on "Submit Reply".
Check if there are mistakes.
Make sure others can understand what you are trying to say.
Write shorter sentences.
If possible, post the input and the expected output.
If your requirements have changed, mention that.
Can you please clearly state what you want?
I am not sure if this is what you are looking for:
All files starting with a "s" will be copied with extension ".cpy"
I am not sure why you need a loop.
Oh its not my day for syntax...
cat gzipsize.txt | awk '{print "echo",$1,$2} > master.txt
I have read a lot about the awk -v but haven't been able to get it to work. I have a variable in my script and I'm looking just to push it into the awk after the $2 (or anywhere would do)!!!
Every... (11 Replies)
hi, i'm new in shell scripting and i'm working on bash on solaris 5.9
after try many stuff with unexpected results, i wonder:
it is not posible in bash, to use a variable that was created inside a loop, out of it?
i mean, for instance:
cat mytext | \
while read text
do
viko=$text... (2 Replies)
Discussion started by: viko
2 Replies
3. Post Here to Contact Site Administrators and Moderators
Where can I download the VTC - Unix Shell Scripting Advanced complete video.
I don't know in which thread I should post this question.Plz help me out, or just tell me the link in the reply to this post.
Thanks in advance. (0 Replies)
Would appreciate if someone can explain the ${0##*/} line. What does it do?
I am aware that $0 is the script name, $# is number of arguments passed in, $* is all the arguments. With the curly brackets {} added in, what's the eventual effect?
Does ${0##*/} actually equals $0$#$*? (something like... (3 Replies)
Hi all
I've got a question regarding error handling in shell scripts. My background is mainly object oriented programming languages, but for a year or so I've been doing more and more (bash) shell scripting (which I quite enjoy by the way).
To handle errors in my scripts I... (3 Replies)
I am not an expert of shell scripting, but I can do some simple things. Now, I read a script written by others and I need some help from the experts of this forum.
Please help me to understand what is going on in this cycle:
if ; then
] && \
export... (25 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am working on a hands on project. We are creating a script for a corporate phone list. The project I am... (2 Replies)
Hi,
How could we take the value of awk variables out to shell?
I know the following methods
1. awk '{print $1}' < file | read a
echo $a
2. a=`awk '{print $1}' < file`
echo $a
Please let me know if there are any other methods.
Also, how do we take more than 1 variable value... (4 Replies)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Dear Unix gurus,
We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
LEARN ABOUT REDHAT
upsrw
UPSRW(8) Network UPS Tools (NUT) UPSRW(8)NAME
upsrw - UPS variable administration tool
SYNOPSIS
upsrw ups
upsrw -h
upsrw -s variable [-u username] [-p password] ups
DESCRIPTION
upsrw allows you to view and change the read/write variables inside your UPS. It sends commands via the server upsd(8) to your driver,
which configures the hardware for you.
The list of variables that allow you to change their values is based on the capabilities of your UPS equipment. Not all models support
this feature. Typically, cheaper hardware does not support any of them. Run upsrw with a UPS identifier to see what will work for you.
OPTIONS -h Display the help message.
-s variable
Specify the variable to be changed inside the UPS. For unattended mode such as in shell scripts, use the format VAR=VALUE to spec-
ify both the variable and the value, for example:
-s HIGHXFER=129
Without this argument, upsrw will just display the list of the variables and their possible values.
Some variables are strings, and can be set to any value within the length limit. Others are enumerated types and can only be set to
one of those values. Refer to the list to know what's available in your hardware.
-u username
Set the username for the connection to the server. This is optional, and you will be prompted for this when using the -s option if
you don't specify -u on the command line.
-p password
Set the password to authenticate to the server. This is also optional like -u, and you will be prompted for it if necessary.
ups View or change the settings on this UPS. The format for this option is [upsname@]hostname[:port].
UNATTENDED MODE
If you run this program inside a shell script or similar to set variables, you will need to specify all of the information on the command
line. This means using -s VAR=VALUE, -u and -p. Otherwise it will put up a prompt and your program will hang.
This is not necessary when displaying the list, as the username and password are not required for read-only mode.
DIAGNOSTICS
upsrw can't set variables on your UPS unless you provide a valid username and password. If you get "access denied" errors, make sure that
your upsd.users(5) has an entry for you, and that the username you are using has permissions to SET variables.
HISTORY
This program used to be called upsct2, which was ambiguous and confusing.
SEE ALSO upsd(8), upscmd(8)
Internet resources:
The NUT (Network UPS Tools) home page: http://www.exploits.org/nut/
NUT mailing list archives and information: http://lists.exploits.org/
Sat Aug 31 2002 UPSRW(8)