I'm sure I'm doing something wrong but as I am new to bash shell scripting I'm not sure what:
Here's the code
webalizer.conf is sitting in the same directory as this file which is named webalizer.sh. Can someone tell me if I've got the syntax right -- it that's correct? I'm executing the... (3 Replies)
Hi guys, I'm new to the forum so forgive me if I'm sounding ... daft.
I currently work in a Tech Support role. Every day we have to generate data by running around 10 .sh scripts. I was thinking instead of having to ./filename 10 times is it possible to right a new script that will run these for... (16 Replies)
I am writing a shell script in bash one of the thing I want to show is size of export /home
du -sk /export/home/oracle | cut -c 1-5
echo "kbytes"
when I run the script kbytes shows up in the second line, How can I append kbytes on the same line, such as
61233 kbytes
please guide
thanks (2 Replies)
So I need a script that does the following:
If a certain user is logged in
Run `command`
Else
Echo “incorrect user”
This is my first stab...which doesn't work:
#!/bin/bash
X="user=`ls -l /dev/console | cut -d " " -f 4`"
Y="foobar"
echo $X
echo $Y (4 Replies)
I have a bash script, but it needs to have a simple protection with password.
So if a user wants to run the script , there should be a kdialog to asks for a password.If the password is correct the script starts to run.
It should not be the passord of root or another admin user.Just a password in... (2 Replies)
I want to write a bash script to:
1. Send an email from localhost to an external gmail account. (gmail then automatically forwards the message back to a pop account on the same server.
2. Script waits 3 minutes then checks to see if the email arrived, and if not, it sends an email to... (9 Replies)
to gather the cpu utilization from a system in 5 minute intervals and direct output to file.
I'm new at scripting and while this seems like an easy task I'm confused on where to start. thanks for any help (1 Reply)
Hello All,
First and foremost, if I have posted this question in the wrong forum/section, I apologize.
Okay so here is my dilemma. I have written a BASH script that automatically restarts a tomcat on a given server. That part was simple enough. However, now I would like to not only restart... (14 Replies)
Hello all!
This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician.
Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix:
... (16 Replies)
I've put together a very simple bash script to check for software patches and bounce the server, once complete. This is on a Mac server. The script works just fine upon execution, however, cron responds with:
/bin/sh: /usr/local/bin/softwareupdates.sh: No such file or directory
Crontab:
... (6 Replies)
Discussion started by: Nvizn
6 Replies
LEARN ABOUT SUNOS
setcat
setcat(3C) Standard C Library Functions setcat(3C)NAME
setcat - define default catalog
SYNOPSIS
#include <pfmt.h>
char *setcat(const char *catalog);
DESCRIPTION
The setcat() function defines the default message catalog to be used by subsequent calls to gettxt(3C), lfmt(3C), or pfmt(3C) that do not
explicitly specify a message catalog.
The catalog argument must be limited to 14 characters. These characters must be selected from a set of all characters values, excluding
(null) and the ASCII codes for / (slash) and : (colon).
The setcat() function assumes that the catalog exists. No checking is done on the argument.
A null pointer passed as an argument will result in the return of a pointer to the current default message catalog name. A pointer to an
empty string passed as an argument will cancel the default catalog.
If no default catalog is specified, or if catalog is an invalid catalog name, subsequent calls to gettxt(3C), lfmt(3C), or pfmt(3C) that do
not explicitely specify a catalog name will use Message not found!!
as default string.
RETURN VALUES
Upon successful completion, setcat() returns a pointer to the catalog name. Otherwise, it returns a null pointer.
EXAMPLES
Example 1: Example of setcat() function.
setcat("test");
gettxt(":10", "hello world
")
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO gettxt(3C), lfmt(3C), pfmt(3C), setlocale(3C), attributes(5), environ(5)SunOS 5.10 29 Dec 1996 setcat(3C)