9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I'm currently rewriting a project from install-required to a pure runtime form.
The former had required the project name and the definition of the command as name, as they all become functions now, this could be shorter.
As you might have figured, the project already exists in another... (3 Replies)
Discussion started by: sea
3 Replies
2. UNIX for Beginners Questions & Answers
#!/bin/awk -f
BEGIN {i=1;file="modified.txt"}
{
if ($0 !~ /^DS:/) {print $0 >> file} else {
if ($0 ~ /^DS:/) {print "DS: ",i >> file;if (i==8) {i=1} else {i++}};
}
}
END {gzip file}
Can someone explain to me how this above script works, I got it from a friend but not able... (3 Replies)
Discussion started by: Kamesh G
3 Replies
3. Shell Programming and Scripting
Hello world! Can someone please explain me how this code works? I'ts supposed to find words in a dictionary and show the anagrams of the words.
{
part = word2key($1)
data = $1
}
function word2key(word, a, i, x, result)
{
x = split(word, a, "")
asort(a)
... (1 Reply)
Discussion started by: jose2802
1 Replies
4. Shell Programming and Scripting
If your Unix box doesn't support bash scripts then do not do the following.
Create a file named version. type chmod 755 version and then copy and paste the code below into the file. Then type "mv version /bin" and presto, type version. A cool full hearty command. If you know more about you're Os... (3 Replies)
Discussion started by: Errigour
3 Replies
5. Shell Programming and Scripting
#!/usr/bin/perl
use strict;
use warnings;
print "Demo of array slicing \n";
my @abc="a b c d e f g h i j k l m n o p q r s t u v w x y z";
my @a=@abc;
my @random=@abc;
my @comp=@abc;
my @comp1=(@abc,"Hello",@abc);
print "abc is @abc \n";
print "a is @a \n";
print "random is @random \n";... (1 Reply)
Discussion started by: dnam9917
1 Replies
6. Shell Programming and Scripting
Can u please explain what it is doing
#!/bin/sh
fullyear=`/home/local/bin/datemmdd 1`"."`date +%Y`
uehist=/u05/home/celldba/utility/ue/prod/history
echo $fullyear
cd $uehist
ls -ltr pwroutages.master.$fullyear* | awk '{print $9}' > /u01/home/celldba/tmp/pwroutages_master_all_tmp
while... (2 Replies)
Discussion started by: raopatwari
2 Replies
7. Shell Programming and Scripting
Hi All;
Is there anybody can explain this script please?
trap 'C_logmsg "F" "CNTL/c OS signal trapped, Script ${G_SCRIPTNAME] terminated"; exit 1' 2
trap 'C_logmsg "F" "Kill Job Event sent from the Console, Script ${G_SCRIPTNAME] terminated"; exit 1' 15 (3 Replies)
Discussion started by: thankbe
3 Replies
8. Shell Programming and Scripting
I am relatively new to Shell Scripting. I can't understand the following two scripts. Can someone please spare a minute to explain?
1) content s of file a are
(021) 654-1234
sed 's/(//g;s/)//g;s/ /-/g' a
021-654-1234
2)cut -d: -f1,3,7 /etc/passwd |sort -t: +1n gives error (3 Replies)
Discussion started by: shahdharmit
3 Replies
9. Shell Programming and Scripting
currently it has the following:
bdumpN=`ll /home/apps/oracle/admin/DBprod/bdump/DBprod_j* | grep "$Cdate" | wc -l`
If I pass the DBname, I would not have to hardcode it in the script...
I can capture the database name by adding the following:
DBname=$1
The problem is, I have been unable... (2 Replies)
Discussion started by: mr_manny
2 Replies
service(8) System Manager's Manual service(8)
NAME
service - run a System V init script
SYNOPSIS
service SCRIPT COMMAND [OPTIONS]
service --status-all
service --help | -h | --version
DESCRIPTION
service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working
directory set to /.
The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the
invoked script, service passes COMMAND and OPTIONS it to the init script unmodified. All scripts should support at least the start and
stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start
command.
service --status-all runs all init scripts, in alphabetical order, with the status command.
EXIT CODES
service calls the init script and returns the status returned by it.
FILES
/etc/init.d
The directory containing System V init scripts.
ENVIRONMENT
LANG, TERM
The only environment variables passed to the init scripts.
SEE ALSO
/etc/init.d/skeleton,
update-rc.d(8),
init(8),
invoke-rc.d(8).
Jan 2006 service(8)