Hi all,
I'm having some problems with a bash script.
It's a backup script that periodically checks if a list of systems is
online, and if so, uses samba to mount a specified list of shares,
rsyncs them to a local directory and unmounts again.
This used to run fine till a few months ago (I don't
On Thu, 02 Sep 2010 10:24:05 +0200
Bernard Scharp freebsd-questi...@itsacon.net articulated:
Hi all,
I'm having some problems with a bash script.
It's a backup script that periodically checks if a list of systems is
online, and if so, uses samba to mount a specified list of shares
Could you post the script? Anything else would be pure guess work. You
Well, I can recreate it with something as simple as:
#!/usr/local/bin/bash
mount_smbfs //u...@remotehost/share1/ /tmp/mnt/
mount_smbfs //u...@remotehost/share2/ /tmp/mnt2/
also might consider posting this on the BASH
On Thu, 02 Sep 2010 14:02:35 +0200, Bernard Scharp
freebsd-questi...@itsacon.net wrote:
Could you post the script? Anything else would be pure guess work. You
Well, I can recreate it with something as simple as:
#!/usr/local/bin/bash
mount_smbfs //u...@remotehost/share1/ /tmp/mnt/
On 02/09/2010 15:29, Polytropon wrote:
On Thu, 02 Sep 2010 14:02:35 +0200, Bernard Scharp
freebsd-questi...@itsacon.net wrote:
Could you post the script? Anything else would be pure guess work. You
Well, I can recreate it with something as simple as:
#!/usr/local/bin/bash
mount_smbfs
On Thu, 02 Sep 2010 15:52:25 +0200, Bernard Scharp
freebsd-questi...@itsacon.net wrote:
Neither am I. Hadn't even thought of grepping in /usr/src for the error
message :-)
It's often a good starting point to see where problems might
be caused from.
Can I just `rm /dev/nsmbX` them? (messing
I have a collection of yearly top 100 Billboard mp3s in this format (all
one line - sorry if it wraps):
/archive/Multimedia/Audio/Music/Billboard Top USA Singles/1980-028 Kenny
Loggins - This Is It.mp3
I want to create symbolic links to the top 30 in 1966-1969 in another
directory for easy
Quoth Drew Tomlinson on Tuesday, 17 August 2010:
I have a collection of yearly top 100 Billboard mp3s in this format (all
one line - sorry if it wraps):
/archive/Multimedia/Audio/Music/Billboard Top USA Singles/1980-028 Kenny
Loggins - This Is It.mp3
I want to create symbolic links to
On 8/17/2010 7:47 AM, Drew Tomlinson wrote:
I have a collection of yearly top 100 Billboard mp3s in this format
(all one line - sorry if it wraps):
/archive/Multimedia/Audio/Music/Billboard Top USA Singles/1980-028
Kenny Loggins - This Is It.mp3
I want to create symbolic links to the top 30
On 8/17/2010 8:22 AM, Chip Camden wrote:
Quoth Drew Tomlinson on Tuesday, 17 August 2010:
I have a collection of yearly top 100 Billboard mp3s in this format (all
one line - sorry if it wraps):
/archive/Multimedia/Audio/Music/Billboard Top USA Singles/1980-028 Kenny
Loggins - This Is
Am Dienstag, den 17.08.2010, 08:22 -0700 schrieb Chip Camden:
find -E ... | while read i; do; basename $i; done
The semicolon behind do isn't necessary.
--
Timm
___
freebsd-questions@freebsd.org mailing list
On Tue, 17 Aug 2010 07:47:25 -0700,
Drew Tomlinson d...@mykitchentable.net said:
D Then I attempt to use 'basename' to extract the file name to a variable
D which I can later pass to 'ln'. This seems to work:
D basename /archive/Multimedia/Audio/Music/Billboard Top USA
D Singles/1980-028
Drew Tomlinson d...@mykitchentable.net writes:
It finally occurred to me that I needed the shell to see a new line as
the delimiter and not whitespace. Then a simple search revealed my
answer:
O=$IFS
IFS=$(echo -en \n\b)
do stuff
IFS=$O
Old IFS value can be preserved by using `local'
I just find out:
#!/usr/local/bin/bash
export IFS=
cuc=$*
mkdir cuc
Thanks anyway!
László
From: Dánielisz László laszlo_daniel...@yahoo.com
To: freebsd-questions@freebsd.org
Sent: Tue, December 1, 2009 8:37:04 PM
Subject: bash script question
Hello,
I'd
Hello,
I'd like to ask how can I read a variable in the same line when I launch a
script?
For example ./script.sh directory_name, and I want the script to creat the
directory called directory_name or whatever I input there.
Thank you!
László
___
On Tue, 1 Dec 2009 11:48:43 -0800 (PST), Dánielisz László
laszlo_daniel...@yahoo.com wrote:
I just find out:
#!/usr/local/bin/bash
export IFS=
cuc=$*
mkdir cuc
The $* variable will expand to all arguments given on the
command line, e. g.
$ ./myscript foo bar baz
will result in
Dánielisz László wrote:
I just find out:
#!/usr/local/bin/bash
export IFS=
cuc=$*
mkdir cuc
Thanks anyway!
László
From: Dánielisz László laszlo_daniel...@yahoo.com
To: freebsd-questions@freebsd.org
Sent: Tue, December 1, 2009 8:37:04 PM
Subject: bash
On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen laz...@lazlarlyricon.com
wrote:
Why are you using bash? To make a shell script as portable as possible,
use /bin/sh. Bash is a third party shell, that isn't included in a base
installation (you're not using bash as root's shell, are you?).
that are bash-only.
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash script?
gary
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe
that are bash-only.
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash script?
gary
--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa
On Tue, 1 Dec 2009 13:45:55 -0800, Gary Kline kl...@thought.org wrote:
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash script?
csh and (ba)sh use dufferent syntax and variable
for maximal portability. Use sh if you're not requiring
features that are bash-only.
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash script?
gary
--
Polytropon
On Tue, Dec 01, 2009 at 11:10:33PM +0100, Polytropon wrote:
On Tue, 1 Dec 2009 13:45:55 -0800, Gary Kline kl...@thought.org wrote:
Hi guys,
Here's a bash-related question, kind-of. Is there any way to
automagically run my .csrhc thru a script and wind up with a
bash
per...@pluto.rain.com wrote:
RW rwmailli...@googlemail.com wrote:
On Sat, 29 Aug 2009 00:06:29 -0700
per...@pluto.rain.com wrote:
Actually, absent some careful cooperation between the
kernel and the interpreter to prevent a race condition ...
isn't that the same issue that Matthew Seaman was
Matthew Seaman m.sea...@infracaninophile.co.uk wrote:
It would do no good for the kernel to hand the interpreter an
open descriptor if the interpreter did not somehow know to read
the script from that open descriptor instead of opening the
script file by name.
Errr -- no. That's what
Michael David Crawford m...@prgmr.com wrote:
It's not that setuid shell scripts are really more
inherently insecure than programs written in C.
Actually, absent some careful cooperation between the kernel
and the interpreter to prevent a race condition that can cause
the interpreter to run
per...@pluto.rain.com wrote:
Actually, absent some careful cooperation between the kernel
and the interpreter to prevent a race condition that can cause
the interpreter to run (with elevated permissions) a completely
different script than the one that was marked setuid, setuid
scripts _are_
On Sat, 29 Aug 2009 00:17:24 -0700, Michael David Crawford m...@prgmr.com
wrote:
I came across a page that explained all the different ways setuid
scripts could screw up - one would have to be a rocket scientist to
avoid all the potential pitfalls.
Hi Michael,
It would be a very useful
On Sat, 29 Aug 2009 00:06:29 -0700
per...@pluto.rain.com wrote:
Michael David Crawford m...@prgmr.com wrote:
It's not that setuid shell scripts are really more
inherently insecure than programs written in C.
Actually, absent some careful cooperation between the kernel
and the interpreter
On Fri, Aug 28, 2009 at 08:10:59PM -0600, Tim Judd wrote:
On 8/28/09, RW rwmailli...@googlemail.com wrote:
On Fri, 28 Aug 2009 11:54:19 +0300
Giorgos Keramidas keram...@ceid.upatras.gr wrote:
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
RW wrote:
On Sat, 29 Aug 2009 00:06:29 -0700
per...@pluto.rain.com wrote:
Michael David Crawford m...@prgmr.com wrote:
It's not that setuid shell scripts are really more
inherently insecure than programs written in C.
Actually, absent some careful cooperation between the kernel
and the
Perhaps a better idea than a setuid shell script, would be to figure out
just what it is about your script that really needs to be executed as root.
When write a C program that can do just that one thing - and absolutely
nothing else.
If it takes any kind of input, or command line
RW rwmailli...@googlemail.com wrote:
On Sat, 29 Aug 2009 00:06:29 -0700
per...@pluto.rain.com wrote:
Actually, absent some careful cooperation between the
kernel and the interpreter to prevent a race condition ...
isn't that the same issue that Matthew Seaman was saying
was fixed years
Hi folks!
Im trying to set up a reaaallly basic scrip to allow one user to shutdown my
machine without root permisions, seting up SUID as follows:
-rwsrwxr-- 1 root wheel 38 Aug 27 23:12 apagar.sh
$ ./apagar.sh
Permission denied
content of script:
cat apagar.sh
]#!/usr/local/bin/bash
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
Hi folks!
Im trying to set up a reaaallly basic scrip to allow one user to shutdown my
machine without root permisions, seting up SUID as follows:
-rwsrwxr-- 1 root wheel 38 Aug 27 23:12 apagar.sh
$
Aham!
so SUID can be applied to sh but it doesn't work!, there is not anyway to
apply it? apart from installing sudo?, The thing is that installing sudo and
adding that user into sudoers, that user will be capable to do any other SU
tasks, apart of shutting down... wich i dont like :D (I know
On Friday 28 August 2009 10:54:19 Giorgos Keramidas wrote:
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
Hi folks!
Im trying to set up a reaaallly basic scrip to allow one user to shutdown
my machine without root permisions, seting up SUID as
On Fri, Aug 28, 2009 at 10:01:54AM +0100, Jeronimo Calvo wrote:
2009/8/28 Giorgos Keramidas keram...@ceid.upatras.gr
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
Im trying to set up a reaaallly basic scrip to allow one user to
shutdown my
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
content of script:
]#!/usr/local/bin/bash
^
This ] doesn't belong to the script, does it?
Furthermore, why do you employ bash for calling another program?
It's standard to use sh (#!/bin/sh) if you don't
On Fri, 28 Aug 2009 11:54:19 +0300
Giorgos Keramidas keram...@ceid.upatras.gr wrote:
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
As far as i know, using SUID, script must runs with root
permissions... so i shoudnt get Permission denied, what im
On 8/28/09, RW rwmailli...@googlemail.com wrote:
On Fri, 28 Aug 2009 11:54:19 +0300
Giorgos Keramidas keram...@ceid.upatras.gr wrote:
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
As far as i know, using SUID, script must runs with root
On Fri, 28 Aug 2009 20:10:59 -0600, Tim Judd taj...@gmail.com wrote:
Dunno, but this dawns on me..
what defines a script? I've always defined a script that starts with
a #! shebang.
So the script can be SUID, but the interpreter/shell isn't. Is that
why it doesn't work?
What is the
On Sat, 29 Aug 2009 02:24:31 +0100, RW rwmailli...@googlemail.com wrote:
On Fri, 28 Aug 2009 11:54:19 +0300 Giorgos Keramidas
keram...@ceid.upatras.gr wrote:
On Fri, 28 Aug 2009 09:24:35 +0100, Jeronimo Calvo
jeronimocal...@googlemail.com wrote:
As far as i know, using SUID, script must runs
RW wrote:
So are scripts actually incapable of running setuid?
They aren't on Linux. I learned about that a while back when I
investigated setuid scripts for a coworker.
It's not that setuid shell scripts are really more inherently insecure
than programs written in C. The problem is more
I am attempting to write a simple Bash script that will find all the
'*.pem' files in a directory structure and move them to another
directory. It seems to work until I get to the copy part where it fails.
My scripting skills are not that good. Perhaps someone could tell me
what I am doing wrong
Hi,
Am Dienstag, 16. Jun 2009, 09:09:09 -0400 schrieb Carmel NY:
[...] It seems to work until I get to the copy part where it fails.
My scripting skills are not that good. Perhaps someone could tell me
what I am doing wrong.
# copy the file to another directory using the base name
cp $i
Hi Carmel
On Wed, Jun 17, 2009 at 8:39 AM, Carmel NY carmel...@hotmail.com wrote:
I am attempting to write a simple Bash script that will find all the
'*.pem' files in a directory structure and move them to another
directory. It seems to work until I get to the copy part where it fails.
My
$ find ./ -name *.pem -exec cp {} /usr/home/tmp/something \;
I'm a novice with shell scripting myself, but what's the difference
between that code and some variant thereof using a pipe and xargs?
Are they simply two different ways of achieving the same result? Or
is there some more important
On Tue, 16 Jun 2009 15:56:15 +0200
Bertram Scharpf li...@bertram-scharpf.de wrote:
Hi,
Am Dienstag, 16. Jun 2009, 09:09:09 -0400 schrieb Carmel NY:
[...] It seems to work until I get to the copy part where it fails.
My scripting skills are not that good. Perhaps someone could tell me
--On Tuesday, June 16, 2009 08:09:09 -0500 Carmel NY carmel...@hotmail.com
wrote:
I am attempting to write a simple Bash script that will find all the
'*.pem' files in a directory structure and move them to another
directory. It seems to work until I get to the copy part where it fails.
My
On Tue, Jun 16, 2009 at 02:33:37PM +, Paul Schmehl wrote:
--On Tuesday, June 16, 2009 08:09:09 -0500 Carmel NY
carmel...@hotmail.com wrote:
I am attempting to write a simple Bash script that will find all the
'*.pem' files in a directory structure and move them to another
directory
Carmel NY wrote:
I am attempting to write a simple Bash script that will find all the
'*.pem' files in a directory structure and move them to another
directory. It seems to work until I get to the copy part where it fails.
My scripting skills are not that good. Perhaps someone could tell me
On Tuesday 16 June 2009 06:03:33 Daniel Underwood wrote:
$ find ./ -name *.pem -exec cp {} /usr/home/tmp/something \;
I'm a novice with shell scripting myself, but what's the difference
between that code and some variant thereof using a pipe and xargs?
Are they simply two different ways of
On Tuesday, June 16, 2009 08:09:09 -0500 Carmel NY
carmel...@hotmail.com wrote:
C I am attempting to write a simple Bash script that will find all the
C '*.pem' files in a directory structure and move them to another
C directory.
Using find and pax will correctly handle filenames
I botched the filter example in my previous blathering. This will ignore
output from find containing patterns:
root# find . -depth -print | fgrep -v -f /some/patterns
Leaving off the -v will keep output containing those patterns.
--
Karl Vogel I don't speak for the USAF
100
admin2 has uid 200
admin3 has uid 300
admin4 has uid 400
How do I make this with bash script?
# echo $line |awk '{ print $1 has uid $2 }'
--
regards,
Artis Caune
. CCNA | BSDA
|
' didii FreeBSD
___
freebsd
:
admin has uid 100
admin2 has uid 200
admin3 has uid 300
admin4 has uid 400
How do I make this with bash script?
Thank you
Kalpin Erlangga Silaen
$ sed -e 's/\(admin[0-9]*\)\ \([0-9]*\)/\1 has uid \2/g' /etc/passwd
Regards,
--
Frank
Contact info: http://www.shute.org.uk/misc
admin3 300
admin4 400
and then I want to echoing into screen:
admin has uid 100
admin2 has uid 200
admin3 has uid 300
admin4 has uid 400
How do I make this with bash script?
Thank you
Kalpin Erlangga Silaen
$ sed -e 's/\(admin[0-9]*\)\ \([0-9]*\)/\1 has uid \2/g
to extract field username and UID from /etc/passwd and passed
into some scripts. Let say I got line
admin 100
admin2 200
admin3 300
admin4 400
and then I want to echoing into screen:
admin has uid 100
admin2 has uid 200
admin3 has uid 300
admin4 has uid 400
How do I make this with bash script?
Thank you
into screen:
admin has uid 100
admin2 has uid 200
admin3 has uid 300
admin4 has uid 400
How do I make this with bash script?
You don't really need bash for this.
Here's a sample awk script that should work:
% cat -n /tmp/userlist.awk
1 #!/usr/bin/awk -f
2
3
line
admin 100
admin2 200
admin3 300
admin4 400
and then I want to echoing into screen:
admin has uid 100
admin2 has uid 200
admin3 has uid 300
admin4 has uid 400
How do I make this with bash script?
You don't really need bash for this.
Here's a sample awk script that should work:
% cat
this with bash script?
Thank you
Kalpin Erlangga Silaen
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]
I have correction with the script but still doesn't work:
#!/usr/local/bin/bash
for user in `ps -A -o user | sort | uniq | tail +2`
do
echo user: $user
ps aux -U $user | tail +2 | while read line
do
mem=`echo $line | awk {'print $4'}`
echo mem: $mem
On 2007-12-17 06:00, Patrick Dung [EMAIL PROTECTED] wrote:
I have correction with the script but still doesn't work:
#!/usr/local/bin/bash
for user in `ps -A -o user | sort | uniq | tail +2`
do
echo user: $user
ps aux -U $user | tail +2 | while read line
do
mem=`echo
Hello, any idea about why below script is not working?
The final sum is empty..
#!/usr/local/bin/bash
for user in `ps -A -o user | sort | uniq | tail +2`
do
echo user: $user
ps aux -U $user | tail +2 | while read line
do
mem=`echo $line | awk {'print $4'}`
echo mem:
Hi all,
I am trying to write a simple bash script that will collate pkg_version
reports from all of my servers to generate centralized HTML reports. To
format the output, I am trying:
# REPORT=`pkg_version -v`
But when I echo $REPORT, I get:
Xaw3d-1.5E_1 = up-to-date with port apr-db42
Hiya.
I've been working on a web front-end to aggregate multiple servers'
package update requirements as well. I'll probably have it ready to
present in another few weeks, if ${DAYJOB} doesn't get in the way.
On Tue, Jun 27, 2006 at 08:01:49AM -0400, dw wrote:
# REPORT=`pkg_version -v`
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of dw
Sent: Tuesday, June 27, 2006 2:02 PM
To: freebsd-questions@freebsd.org
Subject: need help w/ simple bash script
Hi all,
I am trying to write a simple bash script that will collate
[EMAIL PROTECTED] wrote:
My knowledge in bash scripting is about medium not very advanced and all
so I am not attempting to make a connection limiter but what I want to
make is a script that checks the irc connections off a certain user and
takes some actions, mostly of this I know how to do
On Sat, 13 Aug 2005, Giorgos Keramidas wrote:
On 2005-08-12 13:38, Benson Wong [EMAIL PROTECTED] wrote:
I prefer:
for COREFILE in `find / -type f -name core -print`
do
...
done
Wouldn't that accomplish the same thing?
More or less. Less, when the filenames are
On Fri 12 Aug 2005 09:33:54 +0800 Xu Qiang [EMAIL PROTECTED] wrote:
find / -type f -name core -print | while read COREFILE ; do
NCOREFILES=$[ $NCOREFILES + 1 ] # a bit strange - xq
echo $NCOREFILES # xq
I prefer:
for COREFILE in `find / -type f -name core -print`
do
...
done
Wouldn't that accomplish the same thing?
On 8/12/05, Ian Smith [EMAIL PROTECTED] wrote:
On Fri 12 Aug 2005 09:33:54 +0800 Xu Qiang [EMAIL PROTECTED] wrote:
find / -type f -name core -print | while
On 2005-08-12 13:38, Benson Wong [EMAIL PROTECTED] wrote:
I prefer:
for COREFILE in `find / -type f -name core -print`
do
...
done
Wouldn't that accomplish the same thing?
More or less. Less, when the filenames are too many. See questions
posted on this very same list about ``too many
Hi, all:
I don't know if this is the right list to ask this question. But since I didn't
find a bash script mail list and you guys are always so helpful, then...
Here are an excerpt of a bash script:
---
#!/bin/bash
# saveLogs.sh - Bourne
On Fri, 12 Aug 2005, Xu Qiang wrote:
Hi, all:
I don't know if this is the right list to ask this question. But since I
didn't find a bash script mail list and you guys are always so helpful,
then...
Here are an excerpt of a bash script
dpk wrote:
On Fri, 12 Aug 2005, Xu Qiang wrote:
As soon as you used the pipe, to the while, you entered a sub-shell.
There's no way (that I'm aware of anyways) to get the sub-shell's
variables sent back up to the parent.
Thanks for your detailed analysis and a solution. Yes, I didn't notice
On 2005-08-12 10:16, Xu Qiang [EMAIL PROTECTED] wrote:
Btw, can we export a value in the sub-shell back to the parent?
Only through `backquote subtitution', as the child process cannot affect
the environment of the parent process.
value=`shell command`
value=$(shell command)
Giorgos Keramidas wrote:
On 2005-08-12 10:16, Xu Qiang [EMAIL PROTECTED] wrote:
Btw, can we export a value in the sub-shell back to the parent?
Only through `backquote subtitution', as the child process cannot
affect the environment of the parent process.
value=`shell command`
dpk wrote:
On Fri, 12 Aug 2005, Xu Qiang wrote:
1. The way of incrementing the variable NCOREFILES. Why does it use
the formula of NCOREFILES=$[ $NCOREFILES + 1 ], and not the direct
way of NCOREFILES=$NCOREFILES+1?
If that was done, NCOREFILES would end up looking like:
+1+1+1+1+1+1+1
This is my test script:
-
#!/bin/bash
var=0
var=$[3]
vari=0
++vari
echo $var
echo $vari
-
The result is:
./test.sh: ++vari: command not found
3
0
So the manual of bash is incorrect?
Regards,
Xu Qiang
On Fri, 12 Aug 2005, Xu Qiang wrote:
This is my test script:
-
#!/bin/bash
var=0
var=$[3]
vari=0
++vari
echo $var
echo $vari
-
The result is:
./test.sh: ++vari: command not found
3
0
So the manual of bash is incorrect?
Regards,
Xu
dpk wrote:
It will work with either 'let' or within an 'arithmetic expansion':
$[++var]
let ++var
By the way, there is another syntax, from the man page, that seems to
operate identically:
$((++var)) and $((var+1))
With let ++var, the result is still 0, it isn't incremented. With
My knowledge in bash scripting is about medium not very advanced and all
so I am not attempting to make a connection limiter but what I want to
make is a script that checks the irc connections off a certain user and
takes some actions, mostly of this I know how to do but I got stuck at
this :
I
Hello,
I am trying to write a simple bash script that will grep all files in a
directory (except ones that start with 00) for certain bad keywords.
Here is what I have so far:
#!/bin/bash
# This is a simple script to check all sql scripts for bad keywords
BAD_KEYWORDS='spool echo timing commit
On 2005-03-23 12:29, Brian John [EMAIL PROTECTED] wrote:
Hello,
I am trying to write a simple bash script that will grep all files
in a directory (except ones that start with 00) for certain bad
keywords. Here is what I have so far:
#!/bin/bash
# This is a simple script to check all sql
On 2005-03-23 12:29, Brian John [EMAIL PROTECTED] wrote:
Hello,
I am trying to write a simple bash script that will grep all files
in a directory (except ones that start with 00) for certain bad
keywords. Here is what I have so far:
#!/bin/bash
# This is a simple script to check
Brian John wrote:
On 2005-03-23 12:29, Brian John [EMAIL PROTECTED] wrote:
Hello,
I am trying to write a simple bash script that will grep all files
in a directory (except ones that start with 00) for certain bad
keywords. Here is what I have so far:
#!/bin/bash
# This is a simple
I just accidentily wiped one of my script folders. Really no big deal, I'm not
doing multiK scripts. But I had one nice script laying around. It created an
additional window in a named screen session and started a bittorrentheadless
session within.
I do remember that it took me some days to
On Mon, 2003-08-11 at 17:49, Constantine wrote:
Hello!
I am writing a script, which involves unzipping some files. I would have
to unzip 4 different zip-files from some directory, and I would need to
unzip them to the directory, which would have the same name in it as the
original
On Thu, Aug 14, 2003 at 10:46:45AM -0500, Charles Howse wrote:
Hello List,
I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE,
character mode
- no gui.
I'm trying to calculate the number of seconds between
$start_time and
$end_time in a bash script.
Start_time=`date
I'm trying to calculate the number of seconds between $start_time and
$end_time in a bash script.
Bash has built-in integer arithmetic:
et=$[End_time - Start_time]
-- Richard
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman
Charles,
This will set bc precision to 5 decimal places:
et=`echo scale=5 ; $end_time - $start_time | bc`
Ohhh, I was really hoping on that one...but no, it still reports 0
seconds.
Maybe there's something in the script itself that's messing this up.
Here is the entire script:
between
$start_time and
$end_time in a bash script.
Start_time=`date +%s` # Seconds past midnight at start of script
[ do lots of stuff ]
End_time=`date +%s` # Seconds past midnight at end of script
Then I want to: et=`bc $end_time - $start_time` to get the number of
seconds
At 2003-08-14T16:45:56Z, Charles Howse [EMAIL PROTECTED] writes:
I think this whole thing is dependent on the fact that `date +%s` reports
integers.
As his daughter says, DUUUH! I only saw the $end_time and $start_time
variables, and not their origins. I'll go back to lurking now. :)
--
On Thu, Aug 14, 2003 at 12:58:01PM -0500 or thereabouts, Stephen Hilton wrote:
On Thu, 14 Aug 2003 18:34:25 +0100
Jez Hancock [EMAIL PROTECTED] wrote:
On Thu, Aug 14, 2003 at 12:23:34PM -0500, Stephen Hilton wrote:
On Thu, 14 Aug 2003 12:11:55 -0500
Charles Howse [EMAIL PROTECTED]
On Thu, 14 Aug 2003 12:11:55 -0500
Charles Howse [EMAIL PROTECTED] wrote:
Charles,
This will set bc precision to 5 decimal places:
et=`echo scale=5 ; $end_time - $start_time | bc`
Ohhh, I was really hoping on that one...but no, it still reports 0
seconds.
Sorry I jumped the gun
At 2003-08-14T16:08:21Z, Charles Howse [EMAIL PROTECTED] writes:
Can I refine it to give me something like: .784 seconds?
Use bc -l instead of bc. That should do it.
--
Kirk Strauser
pgp0.pgp
Description: PGP signature
The precision is in hundredths of a second as I understand it from
playing with time(!):
#!/bin/sh
time_file=tmp.time
time=time -a -o $time_file
$time cat /var/log/messages /dev/null 21
$time cat /var/log/maillog /dev/null 21
awk '{sum+=$1}END{print sum}' $time_file
rm
On Thu, Aug 14, 2003 at 10:46:45AM -0500, Charles Howse wrote:
Hello List,
I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE, character mode
- no gui.
I'm trying to calculate the number of seconds between $start_time and
$end_time in a bash script.
Start_time=`date +%s
Hello List,
I've migrated from Redhat Linux 9 to FreeBSD 4.8-RELEASE, character mode
- no gui.
I'm trying to calculate the number of seconds between $start_time and
$end_time in a bash script.
Start_time=`date +%s` # Seconds past midnight at start of script
[ do lots of stuff ]
End_time=`date
1 - 100 of 112 matches
Mail list logo