I have a cronjob that executes a small script (few lines) that I am certain can be achieved in a single line.
The functional objective is actually really simple;
The '1' in 'var1' is actually derived from date (day of month) but the snag is when working with 1-9 I require the core numeric (eg: 1, 2, etc not 01, 02, etc) meaning I cannot use 'date +%d' however using %e produces a leading whitespace. So I have addressed that the only simple way I could understand;
How can I get the output from this (eg: 1, 24, 7) onto the back of var to achieve my final goal and do so in a single command line (so I can stuff it into Cron).
PS: I am a newbie but I tried searching first but could not quite what I am after and I am really hoping you can help.
hey gents,
I'm working on something that will use snmpwalk to query the devices on my network and retreive the device name, device IP, device model and device serial. I'm using Nmap for the enumeration and sed to clean up the results for use by snmpwalk. Once i get all the data organized I'm... (8 Replies)
Hi,
I want to make sed write a part of fileA (first 7 lines) to file1 and the rest of fileA to file2 in a single call and single line in sed. If I do the following:
sed '1,7w file1; 8,$w file2' fileA
I get only one file named file1 plus all the characters following file1. If I try to use curly... (1 Reply)
Hi,
I've to do a simple job many times whenever it has been asked, just i've to log in to all of fourtien HP servers and i've to execute
ps -fu user > temp
cat temp|sendmail "xyz@z.com"
commands to send the statics of all of 14 servers over the mail to particular user id..
Though logging... (4 Replies)
Hi,
I would like to write a script with include more than 6 unix commands.
my script like below:
echo " script started"
ls -ld
bdf | grep "rama"
tail -10 log.txt
...
..
...
now, i want to run above unix commands one by one.
example:
first the ls -ld command will be... (3 Replies)
Can somebody help me in solving this..
Input data is like
0 A
1 B
2 C
3 D
0 A1
1 B1
2 C1
3 D1
0 A2
1 B2
2 C2
3 D2
Output should be like
A B C D
A1 B1 C1 D1
A2 B2 C2 D2 (7 Replies)
Hi,
I have a requirement with,
No~Dt~Notes
1~2011/08/1~"aaa
bbb
ccc
ddd
eee
fff
ggg
hhh"
Single column alone got splitted into multiple lines.
I require the output as
No~Dt~Notes
1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh"
mean to say those new lines to be... (1 Reply)
Hi,
I am new to shell scripting and have a question. I would like to redirect the output of multple commands to single file, From what I read from the bash manpage and from some searching it seems it cannot be done within the shell except setting up a loop. Is it?
I am running all clearcase... (1 Reply)
Hi all,
I have a single line output like below
echo $ips
10.26.208.28 10.26.208.26 10.26.208.27
want to convert above single line output as below format. Pls advice how to do ?
10.26.208.28
10.26.208.26
10.26.208.27
Regards
Kannan (6 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
I wish to generate output of two commands in the same line separated by a single white-space.
Below is my command and output in the same line.
ls -ltr fname1.out | awk '{$2=$4=$5=x; print}' | tr '\n' '\t' | tr -s ' '; cksum<fname1.out | cut -d' ' -f1
Output:
-rw-r--r--. root Aug 26 16:57... (6 Replies)
Discussion started by: mohtashims
6 Replies
LEARN ABOUT DEBIAN
ldap2repository
LDAP2REPOSITORY(1) User Contributed Perl Documentation LDAP2REPOSITORY(1)NAME
ldap2repository - creating debian repositories cronjob for the GOsa FAI plugin.
SYNOPSIS
ldap2repository [-hvnpej] [-c config] [-d outdir] [-r srvroot] [-i interface] [-a arch] [-P proxy]
DESCRIPTION
ldap2repository is a script to create the cronjob for the local. debian repositories needed by GOsa FAI plugin.
-c LDAP config file (default: /etc/ldap/ldap.conf)
-d output dir (default: /etc/gosa/fai)
-h display this help and exit
-n skip cleanup for mirrors
-p show progress in cronjob
-v be verbose
-i network interface (default: eth0)
-j create a new /etc/cron.d/goto-fai-backend
-r server root (default: /srv/www)
-e ignore small errors
-a processor architecture (default: i386)
-P proxy (default: none)
BUGS
Please report any bugs, or post any suggestions, to the GOsa mailing list <gosa-devel@oss.gonicus.de> or to
<https://oss.gonicus.de/labs/gosa>
LICENCE AND COPYRIGHT
This code is part of GOsa (<http://www.gosa-project.org>)
Copyright (C) 2005-2006 Jan-Marek Glogowski <glogow@fbihome.de>
2007-2010 The GOsa project <gosa-devel@oss.gonicus.de>
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
perl v5.10.0 2010-05-19 LDAP2REPOSITORY(1)