On 09/20/2012 04:29, Polytropon wrote:
Correct. You could use different approaches which may or may
not fail due to the directory names you will encounter (like
directories with spaces or special characters).
#!/bin/sh
for DIR in `ls -LF | grep \/`; do
cd ${DIR}
Many thanks! The for loop was what was needed.
Polytropon writes:
Just a sidenote: If you're not using bash-specific functionality
and intend to make your script portable, use #!/bin/sh instead.
I always start out that way for that very reason. I needed some
random number functions and
On Thu, 20 Sep 2012 11:16:40 +0200, Jan Henrik Sylvester wrote:
On 09/20/2012 04:29, Polytropon wrote:
Correct. You could use different approaches which may or may
not fail due to the directory names you will encounter (like
directories with spaces or special characters).
#!/bin/sh
I just discovered a knowledge deficiency on my part that
I can't seem to resolve.
If one writes a loop of the following form:
#!/usr/local/bin/bash
ls -LF |grep \/ /tmp/files
while read dirname; do
cd $dirname
#Do whatever commands to be repeated in each directory.
done
On Wed, 19 Sep 2012 21:03:11 -0500 Martin McCormick wrote:
#!/usr/local/bin/bash
ls -LF |grep \/ /tmp/files
while read dirname; do
cd $dirname
#Do whatever commands to be repeated in each directory.
done /tmp/files
How about:
ls -LF | grep \/ | while read dirname; do
cd $dirname
On Wed, 19 Sep 2012 21:03:11 -0500, Martin McCormick wrote:
I just discovered a knowledge deficiency on my part that
I can't seem to resolve.
If one writes a loop of the following form:
#!/usr/local/bin/bash
Just a sidenote: If you're not using bash-specific functionality
and
How Can I simplify/perfect the following script, so that I read _ALL_ the
lines in the file and act on the content as shown below, so that I do not
have to specifiy an action per line?
This below is doing exactly what i need BUT reading one line at a time
untill the 10th line, if i want more i
On Jun 21, 2012, at 6:40 AM, Odhiambo Washington wrote:
How Can I simplify/perfect the following script, so that I read _ALL_ the
lines in the file and act on the content as shown below, so that I do not
have to specifiy an action per line?
This below is doing exactly what i need BUT
On 06/21/2012 08:40 AM, Odhiambo Washington wrote:
How Can I simplify/perfect the following script, so that I read _ALL_ the
lines in the file and act on the content as shown below, so that I do not
have to specifiy an action per line?
This below is doing exactly what i need BUT reading one
CyberLeo Kitsana wrote Odhiambo Washington:
By the way, what's gammu,
/usr/ports/comms/gammu presumably
( for mobile phone connection )
and why is it in /usr/bin ?
Pass.
Cheers,
Julian
--
Julian Stacey, BSD Unix Linux C Sys Eng Consultants Munich http://berklix.com
Reply below not above,
-Original Message-
From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd-
questi...@freebsd.org] On Behalf Of Devin Teske
Sent: Thursday, June 21, 2012 9:24 AM
To: Odhiambo Washington
Cc: questions
Subject: Re: A bash scripting question
On Jun 21, 2012, at 6:40 AM
-Original Message-
From: owner-freebsd-questi...@freebsd.org [mailto:owner-freebsd-
questi...@freebsd.org] On Behalf Of dte...@freebsd.org
Sent: Thursday, June 21, 2012 12:57 PM
To: 'Odhiambo Washington'
Cc: 'questions'
Subject: RE: A bash scripting question
-Original
You know St. Peter won't call my name, freebsd-questions!
2011/01/03 20:23:38 -0800 Joseph Olatt j...@eskimo.com = To Frank Shute :
JO On Sun, Dec 26, 2010 at 05:09:30PM +, Frank Shute wrote:
JO
JO I generally play my tracks of an album like so:
JO
JO for track in $(cat
On Sun, Dec 26, 2010 at 05:09:30PM +, Frank Shute wrote:
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u); do
mplayer $track
done
They then play in the correct order.
How would I go about randomising the order of play using
sh
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u); do
mplayer $track
done
They then play in the correct order.
How would I go about randomising the order of play using
sh (preferably) or perl?
Sorry for the OT posting but I thought a brainteaser
Quoth Frank Shute on Sunday, 26 December 2010:
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u); do
mplayer $track
done
They then play in the correct order.
How would I go about randomising the order of play using
sh (preferably) or
On Sun, 26 Dec 2010 09:40:43 -0800
Chip Camden sterl...@camdensoftware.com wrote:
Quoth Frank Shute on Sunday, 26 December 2010:
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u); do
mplayer $track
done
They then play in the correct
How would I go about randomising the order of play using
sh (preferably) or perl?
I fiddled around for a minute without luck but I think between the
built-in $RANDOM, tail and head you should be able to get a randomize
going. I'd recommend putting a script together that just pulls a random
On Sun, Dec 26, 2010 at 06:01:45PM +, RW wrote:
On Sun, 26 Dec 2010 09:40:43 -0800
Chip Camden sterl...@camdensoftware.com wrote:
Quoth Frank Shute on Sunday, 26 December 2010:
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u);
Frank Shute wrote:
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u); do
mplayer $track
done
They then play in the correct order.
How would I go about randomising the order of play using
sh (preferably) or perl?
cat trombone_shorty-backatown.m3u
On Sun, Dec 26, 2010 at 2:04 PM, b. f. bf1...@googlemail.com wrote:
Frank Shute wrote:
I generally play my tracks of an album like so:
for track in $(cat trombone_shorty-backatown.m3u); do
mplayer $track
done
They then play in the correct order.
How would I go about randomising the
On Dec 26, 2010, at 11:02 AM, Frank Shute wrote:
On Sun, Dec 26, 2010 at 06:01:45PM +, RW wrote:
On Sun, 26 Dec 2010 09:40:43 -0800
Chip Camden sterl...@camdensoftware.com wrote:
Quoth Frank Shute on Sunday, 26 December 2010:
I generally play my tracks of an album like so:
for
Nerius Landys nlan...@gmail.com wrote:
Is there a function, or command line utility, to escape a string,
making it suitable to be input on the command line? For example, this
escape utility would take a input of te st and create an output of
te\ st. Other things such as quotes and single
On 15.02.2010 09:21, Nerius Landys wrote:
But in the case where you're assigning the output of ls directly to a
variable like this:
FOO=`ls`
vs
FOO=`ls`
the text assigned to FOO is the same, right?
Apparently, it is:
sh-4.0$ touch x *
sh-4.0$ FOO=`ls`;echo $FOO|od
000 020170
Nerius Landys nlan...@gmail.com wrote:
#!/bin/sh
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
What if I got rid of extra double quotes? Like this:
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
That is perfectly fine. Word-splitting and filename expansion are
not
#!/bin/sh
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
What if I got rid of extra double quotes? Like this:
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
That is perfectly fine. Word-splitting and filename expansion are
not performed for variable assignments. Also
#!/bin/sh
I have these lines in my script:
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
What if I got rid of extra double quotes? Like this:
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
Does this behave any differently in any kind of case? Are thes double
quotes just
On 15.02.2010 08:07, Nerius Landys wrote:
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
What if I got rid of extra double quotes? Like this:
DIRNAME=`dirname \$0\`
cd $DIRNAME
SCRIPTDIR=`pwd`
Does this behave any differently in any kind of case? Are thes double
quotes just
From the man page:
Command Substitution
[...]
If the substitution appears within double quotes, word splitting and
pathname expansion are not performed on the results.
In other words:
sh-4.0$ touch x y
sh-4.0$ for i in `ls`; do echo $i; done
x
y
sh-4.0$ for i in `ls`; do
Paul Schmehl wrote:
I could do this in perl easily, but I'm trying to force myself to learn
shell scripting better. :-)
...
Once this file is created (or ideally *while* it's being created!) I
need to increment the sid numbers. The first one is 201. The
second needs to be 202,
I could do this in perl easily, but I'm trying to force myself to learn shell
scripting better. :-)
I'm parsing a file to extract some elements from it, then writing the results,
embeded in long strings, into an output file.
Here's the script:
cat file.1 | cut -d',' -f9 | sort | uniq
At 11:35 AM 2/19/2008, Paul Schmehl wrote:
I could do this in perl easily, but I'm trying to force myself to learn
shell scripting better. :-)
I'm parsing a file to extract some elements from it, then writing the
results, embeded in long strings, into an output file.
Here's the script:
Paul Schmehl wrote:
I could do this in perl easily, but I'm trying to force myself to learn
shell scripting better. :-)
I'm parsing a file to extract some elements from it, then writing the
results, embeded in long strings, into an output file.
Here's the script:
cat file.1 | cut
--On Tuesday, February 19, 2008 12:41:43 -0600 Derek Ragona
[EMAIL PROTECTED] wrote:
Thanks to all who offered suggestions. Here's a working script that creates
snort rules *and* a sid-msg.map file:
#!/bin/sh
cat file.1 | cut -d',' -f9 | sort | uniq file.nicks
i=202
j=`wc -l
On Thursday 13 September 2007 20:35, Roland Smith wrote:
On Thu, Sep 13, 2007 at 10:16:40AM -0700, Kurt Buff wrote:
I'm trying to do some text file manipulation, and it's driving me nuts.
[snip]
I've looked at sort and uniq, and I've googled a fair bit but can't
seem to find anything that
I don't have the perl skills, though that would be ideal.
-- snip --
Another approach in Perl would be:
#!/usr/bin/perl
my (%names, %dups);
while () {
my ($key) = split;
$dups{$key} = 1 if $names{$key};
$names{$key} = 1;
}
delete @names{keys %dups};
#
# keys %names is
On Friday 14 September 2007 09:42, Steve Bertrand wrote:
I don't have the perl skills, though that would be ideal.
-- snip --
Another approach in Perl would be:
#!/usr/bin/perl
my (%names, %dups);
while () {
my ($key) = split;
$dups{$key} = 1 if $names{$key};
I'm trying to do some text file manipulation, and it's driving me nuts.
I've got a sorted file of SMTP addresses, and want to eliminate the
lines that are the same up to a space character within the line.
Example:
[EMAIL PROTECTED] NO
[EMAIL PROTECTED] OK
The above lines *both* need to be
On Thu, Sep 13, 2007 at 10:16:40AM -0700, Kurt Buff wrote:
I'm trying to do some text file manipulation, and it's driving me nuts.
I've got a sorted file of SMTP addresses, and want to eliminate the
lines that are the same up to a space character within the line.
Example:
[EMAIL
First, please always make sure your responses go to the list.
It is both list etiquette and of practical value. Follow-ups to
only an individual may not reach the person who can provide real help.
Most Email clients have a group reply which will do the trick.
On Thu, Sep 13, 2007 at 10:32:34AM
On 9/13/07, Jerry McAllister [EMAIL PROTECTED] wrote:
The only space is the one separating the SMTP address from the OK or NO.
Then you should be able to tell it to sort on the first token in
the string with white space as a separator and to eliminate
duplicates. It has been a long time
On 9/13/07, Jerry McAllister [EMAIL PROTECTED] wrote:
First, please always make sure your responses go to the list.
It is both list etiquette and of practical value. Follow-ups to
only an individual may not reach the person who can provide real help.
Most Email clients have a group reply
On Thu, Sep 13, 2007 at 10:16:40AM -0700, Kurt Buff wrote:
I'm trying to do some text file manipulation, and it's driving me nuts.
I've got a sorted file of SMTP addresses, and want to eliminate the
lines that are the same up to a space character within the line.
Example:
[EMAIL
On Sep 13, 2007, at 1:19 PM, Kurt Buff wrote:
I think I may have a better solution. The file I'm trying to massage
has a predecessor - the non-unique lines are the result of a
concatenation of two files.
Silly me, it's better to 'grep -v' with the one file vs. the second
rather than trying to
On 9/13/07, Jerry McAllister [EMAIL PROTECTED] wrote:
The only space is the one separating the SMTP address from the OK or
NO.
Then you should be able to tell it to sort on the first token in
the string with white space as a separator and to eliminate
duplicates. It has been a long time
On 9/13/07, Roland Smith [EMAIL PROTECTED] wrote:
On Thu, Sep 13, 2007 at 10:16:40AM -0700, Kurt Buff wrote:
I'm trying to do some text file manipulation, and it's driving me nuts.
I've got a sorted file of SMTP addresses, and want to eliminate the
lines that are the same up to a space
On 9/13/07, Craig Whipp [EMAIL PROTECTED] wrote:
On 9/13/07, Jerry McAllister [EMAIL PROTECTED] wrote:
The only space is the one separating the SMTP address from the OK or
NO.
Then you should be able to tell it to sort on the first token in
the string with white space as a separator
On 9/13/07, Jeffrey Goldberg [EMAIL PROTECTED] wrote:
On Sep 13, 2007, at 1:19 PM, Kurt Buff wrote:
I think I may have a better solution. The file I'm trying to massage
has a predecessor - the non-unique lines are the result of a
concatenation of two files.
Silly me, it's better to
On Sep 13, 2007, at 2:38 PM, Kurt Buff wrote:
Instead of grep -v take a look at comm.
Interesting! I just looked at the man page, and while I don't think it
it's going to be directly useful (or I'm just not reading the page
correctly), it's a new utility to me - I'll keep it in mind for
On Thursday 13 September 2007 20:19, Kurt Buff wrote:
On 9/13/07, Jerry McAllister [EMAIL PROTECTED] wrote:
The only space is the one separating the SMTP address from the OK or
NO.
Then you should be able to tell it to sort on the first token in
the string with white space as a
Kurt Buff wrote:
I'm trying to do some text file manipulation, and it's driving me nuts.
...
I don't have the perl skills, though that would be ideal.
Any help out there?
Buy Learning Perl, Fourth Edition, read it, and do the exercises:
Eric Crist wrote:
First off, I don't care if you send example in perl, php, or sh, but
we're not a python shop here, so those recommendation will not be
useful...
I'm trying to write a shell script that scans our databases for
tables starting with archive_ which are created by other
Hey all,
First off, I don't care if you send example in perl, php, or sh, but
we're not a python shop here, so those recommendation will not be
useful...
I'm trying to write a shell script that scans our databases for
tables starting with archive_ which are created by other scripts/
Eric Crist wrote:
Hey all,
First off, I don't care if you send example in perl, php, or sh, but
we're not a python shop here, so those recommendation will not be
useful...
I'm trying to write a shell script that scans our databases for tables
starting with archive_ which are created by
Hello all,
I've been upgrading my FreeBSD system into a fully-fledged desktop
system.
zsh as installed (from the port) seems only to recognize the /etc/zshenv
startup file. And I needed an stty command to get proper backspace/delete
behavior. Because only the /etc/zshenv file seemed to be
The problem is likely the that you don't have the full path to stty in your
script, and the automated jobs don't have a proper path set yet. Use the
full pathname in your script and see if that works.
-Derek
At 04:37 PM 1/29/2007, David Benfell wrote:
Hello all,
I've been
In the last episode (Jan 29), David Benfell said:
I've been upgrading my FreeBSD system into a fully-fledged desktop
system.
zsh as installed (from the port) seems only to recognize the
/etc/zshenv startup file. And I needed an stty command to get proper
backspace/delete behavior. Because
On Mon, 29 Jan 2007 17:19:40 -0600, Dan Nelson wrote:
In the last episode (Jan 29), David Benfell said:
I've been upgrading my FreeBSD system into a fully-fledged desktop
system.
zsh as installed (from the port) seems only to recognize the
/etc/zshenv startup file. And I needed an
In the last episode (Jan 29), David Benfell said:
On Mon, 29 Jan 2007 17:19:40 -0600, Dan Nelson wrote:
In the last episode (Jan 29), David Benfell said:
I've been upgrading my FreeBSD system into a fully-fledged
desktop system.
zsh as installed (from the port) seems only to
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives me:
[: missing ]
Looking at rc.subr I see:
if [ ! -d $linkdir ]; then
warn $_me: the directory $linkdir does not exist.
return 1
fi
In response to Robert Huff [EMAIL PROTECTED]:
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives me:
[: missing ]
Looking at rc.subr I see:
if [ ! -d $linkdir ]; then
warn $_me: the directory $linkdir does not
On Jan 3, 2007, at 3:07 PM, Robert Huff wrote:
if [ ! -d foo]
then mkdir foo
fi
You want a space before the ] and a semicolon after it.
--
-Chuck
___
freebsd-questions@freebsd.org mailing list
On 1/3/07, Bill Moran [EMAIL PROTECTED] wrote:
In response to Robert Huff [EMAIL PROTECTED]:
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives me:
[: missing ]
Looking at rc.subr I see:
if [ ! -d $linkdir ]; then
In the last episode (Jan 03), Robert Huff said:
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives me:
[: missing ]
Looking at rc.subr I see:
if [ ! -d $linkdir ]; then
warn $_me: the directory $linkdir does not
On Wed, Jan 03, 2007 at 03:07:43PM -0500, Robert Huff wrote:
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives me:
[: missing ]
It is probably not telling you ':' missing but ';' missing.
It goes after the ']', plus I think the space
On 1/3/07, Jerry McAllister [EMAIL PROTECTED] wrote:
On Wed, Jan 03, 2007 at 03:07:43PM -0500, Robert Huff wrote:
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives me:
[: missing ]
It is probably not telling you ':' missing but ';'
Robert Huff wrote:
This is probably staring me in the face:
if [ ! -d foo]
Missing space ^ here.
ie:
if [ ! -d foo ]
then
mkdir foo
fi
or perhaps more succinctly:
[ -d foo ] || mkdir foo
or best of all, maybe just:
mkdir -p foo
Cheers,
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Kevin Downey wrote:
On 1/3/07, Jerry McAllister [EMAIL PROTECTED] wrote:
On Wed, Jan 03, 2007 at 03:07:43PM -0500, Robert Huff wrote:
This is probably staring me in the face:
if [ ! -d foo]
then mkdir foo
fi
gives
(forgot to cc the list =))
Remove the word root from the crontab entry. The user should be
specified only in the system crontab.
On 10/3/06, jan gestre [EMAIL PROTECTED] wrote:
i made a script and put on root's crontab, however it's not doing or showing
the output that is forwarded to my email
On 10/3/06, Ivan Levchenko [EMAIL PROTECTED] wrote:
Remove the word root from the crontab entry. The user should be
specified only in the system crontab.
thanks ivan, but the solution i made was i put in the
/usr/local/etc/periodic/daily directory, it is now working :D
On 10/3/06, jan
i made a script and put on root's crontab, however it's not doing or showing
the output that is forwarded to my email address correctly therefore i'm not
sure if it is working or not. below is what the script look like:
#
# cvsrun - Weekly CVSup Run
echo Subject: `hostname`
On 10/2/06, jan gestre [EMAIL PROTECTED] wrote:
i made a script and put on root's crontab, however it's not doing or showing
the output that is forwarded to my email address correctly therefore i'm not
sure if it is working or not. below is what the script look like:
...
30 8 * * * root
On Mon, 10 Apr 2006, Malcolm Fitzgerald wrote:
On 10/04/2006, at 12:39 AM, Jan Grant wrote:
On Sun, 9 Apr 2006, Malcolm Fitzgerald wrote:
I'm trying to follow the instructions at
http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/
Your advice got me to step 7 where the need
I'm trying to follow the instructions at
http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/
At point four it offers this shell script.
cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq |
while read X; do
if [ -f $X ]; then echo $X; fi;
done | sort
On 4/9/06, Malcolm Fitzgerald [EMAIL PROTECTED] wrote:
I'm trying to follow the instructions at
http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/
At point four it offers this shell script.
cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq |
while read X; do
On Sun, 9 Apr 2006, Malcolm Fitzgerald wrote:
I'm trying to follow the instructions at
http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/
At point four it offers this shell script.
cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq |
while read X; do
On 10/04/2006, at 12:39 AM, Jan Grant wrote:
On Sun, 9 Apr 2006, Malcolm Fitzgerald wrote:
I'm trying to follow the instructions at
http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/
At point four it offers this shell script.
cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq
On 10/04/2006, at 12:39 AM, Jan Grant wrote:
On Sun, 9 Apr 2006, Malcolm Fitzgerald wrote:
I'm trying to follow the instructions at
http://www.daemonology.net/freebsd-upgrade-5.4-to-6.0/
At point four it offers this shell script.
cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq
I'm thinking about writing an rc.subr script that sucks in variables from a
conf file. Since the rc.firewall script does just that, I thought I'd take
a look at it. But I can't understand what it's doing.
Here's the code:
# Suck in the configuration variables.
if [ -z
On Mar 24, 2006, at 12:12 PM, Paul Schmehl wrote:
Neither rc.conf nor source_rc_confs appears anywhere else in the
script, so how does this suck in the variables? And what does the
syntax . /etc/rc.conf do?
Your second question is the answer to your first question:
. /etc/rc.conf
Yeah, but I am looking for 0 ... 8,9,11,14 are all in use ... but 0-7
are not. I want to:
starting with zero, find the lowest number that is NOT in this list
(where this list is the output of mdconfig -l, which shows which md
devices are currently in use)
Running mdconfig
On Wed, 25 Jan 2006, Luke Bakken wrote:
Thank you very much - you got no output because you have no md devices in
use. I have a few in use and this is the output I get:
# mdconfig -l
md3 md2 md1 md0
But I could just as easily get:
# mdconfig -l
md9 md8 md5 md3
Hmm...I
Thank you very much - you got no output because you have no md devices in
use. I have a few in use and this is the output I get:
# mdconfig -l
md3 md2 md1 md0
But I could just as easily get:
# mdconfig -l
md9 md8 md5 md3
Hmm...I just saw that that line is in
On Wed, 25 Jan 2006, Luke Bakken wrote:
#!/bin/sh
function find_first_mdevice
{
MDDEV='md0 md1 md2 md3 md4 md5 md6 md7 md8 md9'
MDOUT=`mdconfig -l`
for DEV in $MDDEV
do
if ! echo $MDOUT | grep -q $DEV
then
break
fi
done
Hello,
When I mdconfig a device and _do not_ specify a particular numbered md
device (with the -u flag), it just chooses an unused device number for
me. Which makes me happy.
Unfortunately, mdconfig chooses the next available device, from the
highest device currently in use, regardless of
Ensel Sharon wrote:
and I know how to use awk to strip away the leading md from each piece
of the output ... but I do not know how to take output like:
8 9 11 14
and decide that the lowest available number is 0. How can I do this ?
% echo '9 8 11 14' | sort -nt ' ' | head -1
8
--
-Chuck
On Tue, 24 Jan 2006, Chuck Swiger wrote:
Ensel Sharon wrote:
and I know how to use awk to strip away the leading md from each piece
of the output ... but I do not know how to take output like:
8 9 11 14
and decide that the lowest available number is 0. How can I do this ?
%
Ensel Sharon wrote:
and I know how to use awk to strip away the leading md from each piece
of the output ... but I do not know how to take output like:
8 9 11 14
and decide that the lowest available number is 0. How can I do this ?
% echo '9 8 11 14' | sort -nt ' ' | head
Luke,
On Tue, 24 Jan 2006, Luke Bakken wrote:
Yeah, but I am looking for 0 ... 8,9,11,14 are all in use ... but 0-7
are not. I want to:
starting with zero, find the lowest number that is NOT in this list
(where this list is the output of mdconfig -l, which shows which md
devices
I've written a script to check apache to make sure it's running *and*
logging. One of the variables I create is named DATEHOUR, and it's created
by parsing the output of date in such a way that all I get is the hour
(using awk and cut.) I'm comparing DATEHOUR to LOGHOUR, which represents
the
To get the date in the right format you could simply use
date +%H
Greetz,
Ice
Paul Schmehl schrieb:
I've written a script to check apache to make sure it's running *and*
logging. One of the variables I create is named DATEHOUR, and it's
created by parsing the output of date in such a way
--On Monday, September 12, 2005 20:37:22 +0200 Frank Mueller - emendis GmbH
[EMAIL PROTECTED] wrote:
To get the date in the right format you could simply use
date +%H
That solves one-half of the problem. I would still have to get the hour
from the file into the correct format. Otherwise
On 9/12/05, Paul Schmehl [EMAIL PROTECTED] wrote:
How can I strip the leading character from the string so that I can test to
see if it's zero?
This'll strip the 0, while leaving other numbers intact:
$ X=09
$ echo ${X#0}
9
___
--On Monday, September 12, 2005 13:17:05 -0700 David Kirchner [EMAIL PROTECTED]
wrote:
On 9/12/05, Paul Schmehl [EMAIL PROTECTED] wrote:
How can I strip the leading character from the string so that I can test
to see if it's zero?
This'll strip the 0, while leaving other numbers intact:
$
I am recording audio tapes to wav files using gramofile. I'd like to be
able to walk away and automatically shut down the process without
corrupting the wav file. I know the tape duration so I was planning to
use the following script. I'd appreciate a better or more refined
approach:
(sleep
95 matches
Mail list logo