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)
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)
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)
Hi to everyone here,
I'm a new user and relatively-new linuxer.
I'm trying to write a script that checks if every file from a directory is present in a given list and if not, delete it.
should be simple. But I think I've done half the work only:
this is to create the reference list:
for c... (2 Replies)
This is the command. Assume file1 exists but file2 does not:
ls file1 file2 >newfile 2>&1
This simply makes a text file with two lines: file1 \n file2 could not be found. What I don't understand is that when you run this command: ls file1 file2 >newfile, it prints "file2 could not be found" to... (1 Reply)
I have a text file called file1 which contains the text: "ls -l"
When I enter this command:
bash < file1 > file1
file1 gets erased. However if I enter this command:
bash < file1 > newfile
the output from "ls -l" is stored in newfile. My question is why doesn't file1's text ("ls -l") get... (3 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)
Well I searched the net with varying success, but it seems kinda hard to find a one/max 2 lined command to:
strip all *.png files in the folder from their first two characters.
Any help is appreciated.
In DOS commandline of course... (17 Replies)
Discussion started by: pasc
17 Replies
LEARN ABOUT FREEBSD
service
SERVICE(8) BSD System Manager's Manual SERVICE(8)NAME
service -- control (start/stop/etc.) or list system services
SYNOPSIS
service -e
service -R
service [-v] -l | -r
service [-v] <rc.d script> start|stop|etc.
DESCRIPTION
The service command is an easy interface to the rc.d system. Its primary purpose is to start and stop services provided by the rc.d scripts.
When used for this purpose it will set the same restricted environment that is in use at boot time (see below). It can also be used to list
the scripts using various criteria.
The options are as follows:
-e List services that are enabled. The list of scripts to check is compiled using rcorder(8) the same way that it is done in rc(8), then
that list of scripts is checked for an "rcvar" assignment. If present the script is checked to see if it is enabled.
-R Restart all enabled local services.
-l List all files in /etc/rc.d and the local startup directories. As described in rc.conf(5) this is usually /usr/local/etc/rc.d. All
files will be listed whether they are an actual rc.d script or not.
-r Generate the rcorder(8) as in -e above, but list all of the files, not just what is enabled.
-v Be slightly more verbose
ENVIRONMENT
When used to run rc.d scripts the service command sets HOME to / and PATH to /sbin:/bin:/usr/sbin:/usr/bin which is how they are set in
/etc/rc at boot time.
EXIT STATUS
The service utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
The following are examples of typical usage of the service command:
service named status
service -rv
The following programmable completion entry can be use in bash(1) for the names of the rc.d scripts:
_service () {
local cur
cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) )
return 0
}
complete -F _service service
SEE ALSO bash(1) (ports/shells/bash), rc.conf(5), rc(8), rcorder(8)HISTORY
The service utility first appeared in FreeBSD 7.3.
AUTHORS
This manual page was written by Douglas Barton <dougb@FreeBSD.org>.
BSD December 11, 2012 BSD