Jonathan Dowland wrote:
> On Sun, Nov 03, 2013 at 09:58:58PM +0100, Erwan David wrote:
>> Maybe you'll need something like expect to handle this.
> I'd second expect, it's probably the best tool for the job in all
> non-trivial cases.
The "empty-expect" package, perhaps?
Chris
--
To UNSUBSCRI
On 11/4/13, Thomas H. George wrote:
> The script I am trying to write executes a program that requires a
> keyboard response. I have experimented with redirecting STDIN but haven't
> found the
> correct way to make the response.
To read a value (perhaps half your "problem"):
apt-cache show ...
z
trying to do "crazy" stuff, e.g. like
removing essential packages. Even the simpler questions are there to
give you a chance not to shoot yourself in the foot: If you script the
answers to them, your (metaphorical) foot is in danger...
> I'm sure this must be elementary but I have
The tool 'yes' can be used to write an infinite stream of strings
(the default being 'y') to standard output, so if your program needed
only a sequence of a fixed string such as 'y', you could do
> yes | your-program
or
> yes "some-other-string" | your-program
But if your program is not readin
e
> response from apt-get install for the letter y and fed this back to
> install . In my case I must respond with a word in answer to the
> programs question.
>
> I'm sure this must be elementary but I have read large sections of
> BASH GUIDE FOR BEGINNERS and AVANCE
> The script I am trying to write executes a program
> that requires a keyboard response.
>
A varaible can be set to a keyboard response
using a read prompt
read -e -p "What do you need ?" xVariable
echo $xVariable
--
Stanley C. Kitching
Human Being
Phoenix, Arizon
ck to
install . In my case I must respond with a word in answer to the
programs question.
I'm sure this must be elementary but I have read large sections of
BASH GUIDE FOR BEGINNERS and AVANCED BASH-SCRIPTING GUIDE without
finding a solution. I would appreciate a little help or ad
On Tue, 30 Oct 2012 08:58:31 +0100, Chris Davies
wrote:
done=$(date +%s)
month=$(date --date @$done +%B)
mon=$(date --date @$done +%b)
d_y_t=$(date --date @$done +'/%d/%Y %T')
I agree, good idea.
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subj
Ralf Mardorf wrote:
> month=$(date +%B)
> mon=$(date +%b)
> d_y_t=$(date '+/%d/%Y %T')
> done=$(date +%s)
You've got a horrible race condition in there just waiting to bite
you. Try this instead:
done=$(date +%s)
month=$(date --date @$done +%B)
mon=$(date --date @$done +%b)
d_y_t
On Mon, 2012-10-29 at 18:52 -0400, Neal Murphy wrote:
> What's the '+100' supposed to do?
### Killall and Restore session
started=$(date +%s)
SECONDS=0
sleep 2
### Time
month=$(date +%B)
mon=$(date +%b)
d_y_t=$(date '+/%d/%Y %T')
done=$(date +%s)
done_2=$SECONDS
((seconds=(done-start
On Mon, 2012-10-29 at 21:31 +, Dom wrote:
> Would this do what you are after?
>
> ### Killall and Restore session
> started=$(date +%s)
> sleep 2
>
> ### Time
> month=$(date +%B)
> mon=$(date +%b)
> d_y_t=$(date '+/%d/%Y %T')
> done=$(date +%s)
> echo
> printf "Attended time to restore sessio
On Monday, October 29, 2012 04:31:03 PM Ralf Mardorf wrote:
> FOR YOUR EXAMPLE, IIUC IT SHOULD BE? ...
>
> ### Killall and Restore session
> started=$(date +%s)
> sleep 2
>
> ### Time
> month=$(date +%B)
> mon=$(date +%b)
> d_y_t=$(date '+/%d/%Y %T')
> done=$(date +%s)
> #((seconds=(don
On 29/10/12 20:31, Ralf Mardorf wrote:
(trimmed)
I want
((seconds=(done-started)-(((done-started)/60)*60)+100))
min_sec=$(((done-started)/60))":"${seconds: -2}
in one line, instead of two lines.
I don't understand your reply.
Even if I would add ${min_sec: 2} to each "echo" command (ther
> ... WHILE I WONT THIS 2 lines, AS ONE LINE, INCLUDING THE FORMATTING:
Oops, an evil typo ;), it should be "... while I want". The capital
letters aren't for shouting, just to distinguish the mail's text from
the script.
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a
On Mon, 2012-10-29 at 15:59 -0400, Neal Murphy wrote:
> On Monday, October 29, 2012 03:26:20 PM Ralf Mardorf wrote:
>
> > On Mon, 2012-10-29 at 15:00 -0400, Wolf Halton wrote:
>
> > > On Mon, Oct 29, 2012 at 6:57 AM, Ralf Mardorf
>
> > >
>
> > > wrote:
>
> > > > Hi :)
>
> > > >
>
> > > >
On Monday, October 29, 2012 03:26:20 PM Ralf Mardorf wrote:
> On Mon, 2012-10-29 at 15:00 -0400, Wolf Halton wrote:
> > On Mon, Oct 29, 2012 at 6:57 AM, Ralf Mardorf
> >
> > wrote:
> > > Hi :)
> > >
> > > how can I get rid of the variable "seconds"?
> > >
> > > ((seconds=(done-started)-(((done-
On Mon, 2012-10-29 at 15:00 -0400, Wolf Halton wrote:
> On Mon, Oct 29, 2012 at 6:57 AM, Ralf Mardorf
> wrote:
> > Hi :)
> >
> > how can I get rid of the variable "seconds"?
> >
> > ((seconds=(done-started)-(((done-started)/60)*60)+100))
> > min_sec=$(((done-started)/60))":"${seconds: -2}
> >
Here's something I modified as part of a benchmark script called "fdtree".
--
Karl Vogel I don't speak for the USAF or my company
Dijkstra probably hates me. --Linus Torvalds, in kernel/sched.c
#!/bin/bash
# How to use xdate/xtime/persec:
#
# START=$(date "+%s")
On 2010-03-29 16:35, Mike McClain wrote:
[snip]
Thanks a lot. Though my error was pointed out as a typo and corrected
a while back your solution using " date '+%s' " is much more elegant
than what I had done.
If you want more (possibly too much) precision:
$ date +'%s.%N'
--
"History does not
Hi Josep,
On Mon, Mar 29, 2010 at 02:28:20PM +0200, Josep M. wrote:
>
> I found these somewhere time ago. check if is what You need:
>
Thanks a lot. Though my error was pointed out as a typo and corrected
a while back your solution using " date '+%s' " is much more elegant
than what I had don
Hello.
I found these somewhere time ago. check if is what You need:
function timer()
{
if [[ $# -eq 0 ]]; then
echo $(date '+%s')
else
local stime=$1
etime=$(date '+%s')
if [[ -z "$stime" ]]; then stime=$etime; fi
dt=$((etime - stime)
Paul E Condon wrote:
Try:
bgn=$(date +%s)
sleep 7
end=$(date +%s)
echo "elapsed seconds = " $(( end - bgn ))
You might also want to experiment with:
ps h -o etime $$
as long as you're happy with it only running under gnu. Prints the
elapsed time for the shell.
--
Chris Jackson
Shadowcat
On 20100319_101928, Mike McClain wrote:
> I've written a function to print elapsed time similar to /usr/bin/time
> but can be called at the beginning and end of a script from within
> the script. Occasionally I get an error: '8-08: value too great for base'
> It's caused by the difference in these
On Fri, Mar 19, 2010 at 06:45:15PM +0100, Sven Joachim wrote:
> On 2010-03-19 18:19 +0100, Mike McClain wrote:
>
> > I've written a function to print elapsed time similar to /usr/bin/time
> > but can be called at the beginning and end of a script from within
> > the script. Occasionally I get an e
On Fri, Mar 19, 2010 at 10:19:28AM -0700, Mike McClain wrote:
typo right herevv
> now='09:07:16'; startHr=${now%%:*}; startHR=${startHr#*0}; echo $startHr;
Apologies for troubling all.
Mike (with egg on face)
--
Satisfied user of Linux since 1997.
O< ascii ribbon c
Mike McClain wrote:
I've written a function to print elapsed time similar to /usr/bin/time
but can be called at the beginning and end of a script from within
the script. Occasionally I get an error: '8-08: value too great for base'
It's caused by the difference in these 2 command strings but I ca
Mike McClain wrote:
I've written a function to print elapsed time similar to /usr/bin/time
but can be called at the beginning and end of a script from within
the script. Occasionally I get an error: '8-08: value too great for base'
It's caused by the difference in these 2 command strings but I c
On Fri, Mar 19, 2010 at 1:19 PM, Mike McClain wrote:
> I've written a function to print elapsed time similar to /usr/bin/time
> but can be called at the beginning and end of a script from within
> the script. Occasionally I get an error: '8-08: value too great for base'
> It's caused by the diffe
On 2010-03-19 18:19 +0100, Mike McClain wrote:
> I've written a function to print elapsed time similar to /usr/bin/time
> but can be called at the beginning and end of a script from within
> the script. Occasionally I get an error: '8-08: value too great for base'
> It's caused by the difference i
I've written a function to print elapsed time similar to /usr/bin/time
but can be called at the beginning and end of a script from within
the script. Occasionally I get an error: '8-08: value too great for base'
It's caused by the difference in these 2 command strings but I can't for
the life of m
Tyler Smith wrote:
On 2007-05-17, Bob McGowan <[EMAIL PROTECTED]> wrote:
Some general comments, mostly aimed at making your code cleaner without
changing what it does.
First, both 'echo' and 'printf' put their results on standard out. Your
call of 'printf' is inside command substitution, so
On Thu, May 17, 2007 at 03:40:15AM +, Tyler Smith wrote:
> On 2007-05-17, Bob McGowan <[EMAIL PROTECTED]> wrote:
> >
> > Some general comments, mostly aimed at making your code cleaner without
> > changing what it does.
> >
> > First, both 'echo' and 'printf' put their results on standard out.
On 2007-05-17, Bob McGowan <[EMAIL PROTECTED]> wrote:
>
> Some general comments, mostly aimed at making your code cleaner without
> changing what it does.
>
> First, both 'echo' and 'printf' put their results on standard out. Your
> call of 'printf' is inside command substitution, so its STDOUT
Tyler Smith wrote:
Hi,
I've got a question about a short bash script I wrote. I need it to
--snipped--
#!/bin/bash
lab_num=41
for map_name in aest_90 bush_90 carol_90 comp_90 \
hirs_90 roan_90 swan_90 vir_90 ;
do
lab_let=$(echo -n $(printf "\\x$(echo $lab_num)"))
echo "
$la
On 2007-05-16, Karl E. Jorgensen <[EMAIL PROTECTED]> wrote:
>> This was the only way I could figure out to loop from A to H. But
>> since it works on hex escape codes, it won't work past 9. Is there a
>> cleaner, more general way to do this?
>
> I think there is:
>
> #!/bin/bash
>
> ( cat < A aest_
On Wed, May 16, 2007 at 08:46:37PM +, Tyler Smith wrote:
> Hi,
>
> I've got a question about a short bash script I wrote. I need it to
> loop over a number of names, and pass a command to grass that includes
> two variations of those names. That was easy. Harder was getting
> getting a letter
Hi,
I've got a question about a short bash script I wrote. I need it to
loop over a number of names, and pass a command to grass that includes
two variations of those names. That was easy. Harder was getting
getting a letter included in each iteration, starting with A for the
first one and going u
On Fri, Sep 29, 2006 at 08:02:38AM -0500, Hugo Vanwoerkom wrote:
> Kevin Mark wrote:
> >On Wed, Sep 27, 2006 at 09:22:05PM -0500, Ron Johnson wrote:
> >>how about
> >> b=`$a`
> >> echo $b
> >
> >or
> >echo $($a)
>
>
> Bingo!!! Th
Hugo Vanwoerkom wrote:
Hi,
On my way to elapsed time in a bash script, I created the do_chrono
command. It pumps the elapsed time to stdout.
So if I do:
a=do_chrono
and then:
$a
I get: 0:3:19.
Problem: I can't use that $a anywhere, e.g. if I say:
echo $a
I would expect to see 0:3:19 ag
Kevin Mark wrote:
On Wed, Sep 27, 2006 at 09:22:05PM -0500, Ron Johnson wrote:
how about
b=`$a`
echo $b
or
echo $($a)
Bingo!!! Thanks!
Is that in the Advanced Bash-Scripting Guide?
H
echo `$a`
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubs
Atle Veka wrote:
In your example you are saying that $a is the function 'do_chrono', so
when you run $a, it runs the function and prints out the result. As
another poster indicated, you need to do it slightly differently:
# execute and store result in $a
a=$( do_chrono )
# print
echo $a
Yup
Ron Johnson wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 09/27/06 18:51, Hugo Vanwoerkom wrote:
Hi,
On my way to elapsed time in a bash script, I created the do_chrono
command. It pumps the elapsed time to stdout.
So if I do:
a=do_chrono
and then:
$a
I get: 0:3:19.
Problem: I
On Wed, Sep 27, 2006 at 09:22:05PM -0500, Ron Johnson wrote:
>
> how about
> b=`$a`
> echo $b
or
echo $($a)
echo `$a`
--
| .''`. == Debian GNU/Linux == | my web site: |
| : :' : The Universal | debian.home.pipeline.com |
| `. `' Operating System| go to coun
In your example you are saying that $a is the function 'do_chrono', so
when you run $a, it runs the function and prints out the result. As
another poster indicated, you need to do it slightly differently:
# execute and store result in $a
a=$( do_chrono )
# print
echo $a
Atle
-
Flying Crocodile
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 09/27/06 18:51, Hugo Vanwoerkom wrote:
> Hi,
>
> On my way to elapsed time in a bash script, I created the do_chrono
> command. It pumps the elapsed time to stdout.
>
> So if I do:
>
> a=do_chrono
>
> and then:
>
> $a
>
> I get: 0:3:19.
>
> P
Hi,
On my way to elapsed time in a bash script, I created the do_chrono
command. It pumps the elapsed time to stdout.
So if I do:
a=do_chrono
and then:
$a
I get: 0:3:19.
Problem: I can't use that $a anywhere, e.g. if I say:
echo $a
I would expect to see 0:3:19 again, but I don't, it say
On 11/25/05, Metrics <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Can someone explain to me the following behaviour? I have this script
>
> #!/bin/sh
>
> LISTS=('debian-user' 'security-basics' 'hostap' 'pen-test' 'ntbugtraq'
> 'ion-general' 'vim' 'madwifi');
> LIST_COUNT=${#LISTS}
> echo $LIST_COUNT
>
Hi all,
Can someone explain to me the following behaviour? I have this script
#!/bin/sh
LISTS=('debian-user' 'security-basics' 'hostap' 'pen-test' 'ntbugtraq'
'ion-general' 'vim' 'madwifi');
LIST_COUNT=${#LISTS}
echo $LIST_COUNT
for ((i=0;i<$LIST_COUNT-1;i++)); do
echo /home/bhillis/Ma
Hi, all
What do you think about the abs-guide package in debian distro?
How about a `better` book on bash scripting?
Hui
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
On Mon, Jan 26, 2004 at 12:33:53AM -0500, Matt Price wrote:
> hey everyone,
>
> trying to get procmail to pipe messages to a script I wrote that
> processes mail to a web page. Here's the recipe:
> ---
Hi Matt,
did you do any testing?
did you create a sam
On 26 Jan 2004, Matt Price <[EMAIL PROTECTED]> wrote:
> So I asusme the script is running, but it's not receiving the data it
> needs, or at least not understanding it.
>
> Here's the script, which as ou see is very primitive:
> --
> cat /usr/local/scripts/movi
hey everyone,
trying to get procmail to pipe messages to a script I wrote that
processes mail to a web page. Here's the recipe:
---
:0:
* ? $FORMAIL -x From: | grep -isF -f /home/movies/friends_and_family.txt
| /usr/local/scripts/moviepage
--
Matt Price <[EMAIL PROTECTED]> writes:
> here's something that ocmes up a lot for me:
>
> I use locate to find a bunch of files:
>
> % locate charter | grep -i font
> /usr/share/texmf/fonts/afm/bitstrea/charter
> /usr/share/texmf/fonts/tfm/bitstrea/charter
> /usr/share/texmf/fonts/type1/bitstrea
On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote:
[...]
} ls < locate charter | grep -i font
} ?
} nothing I try works -- but I can't believe it's impossible! any
} hints?
locate charter | grep -i font | tr '\012' '\000' | xargs -0 ls -ld
xargs is your friend. So is tr. Learn them an
On Sat, 03 Jan 2004 23:34:59 -0800, Nano Nano wrote:
> On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote:
>> so I have to do it by hand at the moment. But shouldn't I be able to
>> automate it with somthing like:
>>
>> ls < locate charter | grep -i font
>> ?
>> nothing I try works -- b
On Sun, Jan 04, 2004 at 03:36:36AM -0500, Kevin Mark wrote:
> I use a little bash code over and over again.
> Its a while loop.
>
> locate charter| grep -i font | while read line; do
> ls -l $line;
> done
>
> It has many uses and it doesnt have a limit like xargs.
> I found out about xargs
On Sun, Jan 04, 2004 at 01:10:51AM -0800, Nano Nano wrote:
[snip]
> it looks messier) and you can't use the sort options of less, for
i meant sort options of ls
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
On Sun, Jan 04, 2004 at 03:36:36AM -0500, Kevin Mark wrote:
[snip]
>
> locate charter| grep -i font | while read line; do
> ls -l $line;
> done
Invoking 'ls' in a loop is semantically different from invoking it once,
although you can compensate for it. I prefer backticks because you can
On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote:
> hey folks,
>
> here's something that ocmes up a lot for me:
>
> I use locate to find a bunch of files:
>
> % locate charter | grep -i font
> /usr/share/texmf/fonts/afm/bitstrea/charter
> /usr/share/texmf/fonts/tfm/bitstrea/charter
>
On Sun, Jan 04, 2004 at 02:27:11AM -0500, Matt Price wrote:
> so I have to do it by hand at the moment. But shouldn't I be able to
> automate it with somthing like:
>
> ls < locate charter | grep -i font
> ?
> nothing I try works -- but I can't believe it's impossible! any
> hints?
I use back
hey folks,
here's something that ocmes up a lot for me:
I use locate to find a bunch of files:
% locate charter | grep -i font
/usr/share/texmf/fonts/afm/bitstrea/charter
/usr/share/texmf/fonts/tfm/bitstrea/charter
/usr/share/texmf/fonts/type1/bitstrea/charter
/usr/share/texmf/fonts/vf/bitstre
On Mon, 2003-03-10 at 01:02, Jeff Elkins wrote:
> Jeff Elkins <[EMAIL PROTECTED]> writes:
> > ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
> > s/arm.*/arm/ -e s/sa110/arm/
> >
> > I'm working on polishing my meagre shell scripting skills and would
> > appreciate some feedba
Jeff Elkins <[EMAIL PROTECTED]> writes:
> ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
> s/arm.*/arm/ -e s/sa110/arm/
>
> I'm working on polishing my meagre shell scripting skills and would
> appreciate some feedback on the line above, quoted from the kernel
> Makefile.
Th
Hi Jeff,
Jeff Elkins <[EMAIL PROTECTED]> writes:
> ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
> s/arm.*/arm/ -e s/sa110/arm/
>
> I'm working on polishing my meagre shell scripting skills and would
> appreciate some feedback on the line above, quoted from the ke
Jeff Elkins wrote:
> ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
> s/arm.*/arm/ -e s/sa110/arm/
>
> I'm working on polishing my meagre shell scripting skills and would
> appreciate some feedback on the line above, quoted from the kernel Makefile.
Ew, that line seems to
David Z Maze wrote:
> Two somewhat common ways:
>
> uname -m | grep i.86 > /dev/null && echo x86
My I suggest using 'grep -q' to save the need to redirect?
> case `uname -m` in
> i?86) echo x86 ;;
> esac
I prefer the case statement approach.
Bob
pgp0.pgp
Description: PGP signat
Jeff Elkins <[EMAIL PROTECTED]> writes:
> ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
> s/arm.*/arm/ -e s/sa110/arm/
>
> I'm working on polishing my meagre shell scripting skills and would
> appreciate some feedback on the line above, quoted from the kernel Makefile.
>
>
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e
s/arm.*/arm/ -e s/sa110/arm/
I'm working on polishing my meagre shell scripting skills and would
appreciate some feedback on the line above, quoted from the kernel Makefile.
1. How would you use this in a straight bash script
On Sun, Nov 03, 2002 at 12:28:26PM -0700, Bob Proulx wrote:
> get around 40,000 files in one single directory. Some filesystems
> such as JFS (and I think, not sure, XFS and ReiserFS too) store
> directies in B+ trees and are specifically designed to handle large
I know that ReiserFS does this. X
Neal Lippman <[EMAIL PROTECTED]> [2002-11-03 13:35:22 -0500]:
> Thanks. My "bug" here was using comma instead of space as the separator,
> and not realizing that the reason for x in {a,b,c,d...z} worked was
> because of the way the brace expansion was being done by the shell.
Ah, yes, csh style {o
On Sat, Nov 02, 2002 at 10:51:00PM -0500, Neal Lippman wrote:
>
> This works fine if I actually type out the entire alphabet list on the
> command line as above, but that's sort of a pain. So, I tried setting a
> shell variable to the alphabet string (export alpha="A,B,C,...,Z"), but
> then the co
Neal Lippman <[EMAIL PROTECTED]> [2002-11-02 22:51:00 -0500]:
> I am trying to solve a bash scripting problem, but I cannot figure it
> out.
>
> I frequently need to execute a command of the form:
> for x in {A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V
[EMAIL PROTECTED] <[EMAIL PROTECTED]> [2002-11-03 18:15:06 +0200]:
> On Sat, Nov 02, 2002 at 10:05:45PM -0600, Michael Heironimus wrote:
> > alpha="a b c d e z"
> > for x in $alpha ; do
> > echo $x
> > done
> >
> > I think this should work in any Bourne-style shell
>
> Doesn't wo
Matthias Hentges <[EMAIL PROTECTED]> [2002-11-03 18:32:29 +0100]:
> Am Son, 2002-11-03 um 04.51 schrieb Neal Lippman:
> > I frequently need to execute a command of the form:
> > for x in {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); do
> Your problem ist the wrong setting of th
Am Son, 2002-11-03 um 04.51 schrieb Neal Lippman:
> I am trying to solve a bash scripting problem, but I cannot figure it
> out.
>
> I frequently need to execute a command of the form:
> for x in {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
On Sat, Nov 02, 2002 at 10:05:45PM -0600, Michael Heironimus wrote:
> On Sat, Nov 02, 2002 at 10:51:00PM -0500, Neal Lippman wrote:
> > shell variable to the alphabet string (export alpha="A,B,C,...,Z"), but
> > then the command:
> > for x in {$alpha} ;
> > do
> > echo $x;
> >
On Sat, Nov 02, 2002 at 10:51:00PM -0500, Neal Lippman wrote:
> shell variable to the alphabet string (export alpha="A,B,C,...,Z"), but
> then the command:
> for x in {$alpha} ;
> do
> echo $x;
> done
> winds up printing the string "{A,B,C,...,Z}" rather than each l
I am trying to solve a bash scripting problem, but I cannot figure it
out.
I frequently need to execute a command of the form:
for x in {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); do
;
done
This works fine if I actually type out the entire
Thank you all! Now it works.
* Gustavo Noronha Silva <[EMAIL PROTECTED]> [020320 09:25]:
...
> C="$A $B"
--
Karsten Heymann <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
CAU-University Kiel, Germany
Registered Linux User #221014 (http://counter.li.org)
On Tue, Mar 19, 2002 at 08:35:53PM +0100, Karsten Heymann wrote:
> Hi,
>
> I have once again come upon bash problem I can't solve. I'm writing a
> little bash frontend and one of the programs expects a option that includes
> spaces and is composed from two other shell var's. Example:
>
> #!/bin/b
Karsten Heymann, Tue, Mar 19, 2002 at 08:35:53PM +0100:
> Hi,
>
> I have once again come upon bash problem I can't solve. I'm writing a
> little bash frontend and one of the programs expects a option that includes
> spaces and is composed from two other shell var's. Example:
>
> #!/bin/bash
> A=
On Tue, 19 Mar 2002 20:35:53 +0100
Karsten Heymann <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have once again come upon bash problem I can't solve. I'm writing a
> little bash frontend and one of the programs expects a option that includes
> spaces and is composed from two other shell var's. Example:
Karsten Heymann <[EMAIL PROTECTED]> writes:
> Hi,
>
> I have once again come upon bash problem I can't solve. I'm writing
> a little bash frontend and one of the programs expects a option that
> includes spaces and is composed from two other shell var's. Example:
>
> #!/bin/bash
> A="Hello"
> B="
B"
> C='$A $B'
> C=$A\ $B
> C=`echo $A $B`
>
> What works is
> someprog --greeting "Hello Karsten"
> but that's no solution.
try someprot --greeting "$A $B"
There's an excelleng bash scripting HOWTO (don't know the URL right of t
On Tue, Mar 19, 2002 at 20:35:53 +0100, Karsten Heymann wrote:
> A="Hello"
> B="Karsten"
> C=$A $B
> someprog --greeting $C
Variable expansion happens first:
someprog --greeting Hello Karsten
then tokenising, so someprog get three arguments:
1. --greeting
2. Hello
On Tue, Mar 19, 2002 at 08:35:53PM +0100, Karsten Heymann wrote:
> Hi,
>
> I have once again come upon bash problem I can't solve. I'm writing a
> little bash frontend and one of the programs expects a option that includes
> spaces and is composed from two other shell var's. Example:
>
> #!/bin/b
This should work, though I have not actually tried it:
#!/bin/bash
A="Hello"
B="Karsten"
C="$A $B"
someprog --greeting "$C"
pgpiX8Z2JqpWm.pgp
Description: PGP signature
Hi,
I have once again come upon bash problem I can't solve. I'm writing a
little bash frontend and one of the programs expects a option that includes
spaces and is composed from two other shell var's. Example:
#!/bin/bash
A="Hello"
B="Karsten"
C=$A $B
someprog --greeting $C
Whatever I do now, -
D-Man writes:
> If he wants to start with bash he can. I think bash scripting is harder
> than python though.
Poor shell programming is quite easy. Good shell progamming is harder than
good Python programming.
--
John Hasler
[EMAIL PROTECTED]
Dancing Horse Hill
Elmwood, Wisconsin
On Tue, Jan 30, 2001 at 10:55:53PM +0100, William Leese wrote:
[snip]
| > BTW, I don't use bash scripting for anything other than running
| > programs with some default options. I would prefer to use python for
| > this sort of thing, but it's up to you what you want to
On Tue, Jan 30, 2001 at 09:40:53PM +0100, William Leese wrote:
> hi all
>
> i need a little help on a script. the following scripts function is to merge
> several parts of a html page together and insert a new piece of text from
> text.txt also it has to replace some words (the title, author, su
D-Man wrote:
>sed "s/Title/$TITLE/g" title.html >> file.txt &&
>
>Also, I'm not sure why you have double & at the end of the line. I
>think you want to run sed in the foreground, not the background. I
>don't understand what the second & does.
& by itself mean s to run in the backgr
, ofcourse..
> | I think the g is missing, that is all I noticed
>
> You only need the g if the text to replace occurs more than once on a
> line. If it doesn't, it doesn't matter. If it does, do you want to
> replace all occurences or just the first?
its just a one
On 30-Jan-2001 William Leese wrote:
> hi all
>
> i need a little help on a script. the following scripts function is to merge
> several parts of a html page together and insert a new piece of text from
> text.txt also it has to replace some words (the title, author, submittor, and
> date) with
and what the second & does.
| I think the g is missing, that is all I noticed
You only need the g if the text to replace occurs more than once on a
line. If it doesn't, it doesn't matter. If it does, do you want to
replace all occurences or just the first?
|
| Ciao, mattHias
|
|
William Leese wrote:
> sed 's/Title/$TITLE/g' title.html >> file.txt &&
^
I think the g is missing, that is all I noticed
Ciao, mattHias
--
__ _ __ *
/\_/\ \ \_/ \_/ / * Matthias Wieser *
/ \ \ /
hi all
i need a little help on a script. the following scripts function is to merge
several parts of a html page together and insert a new piece of text from
text.txt also it has to replace some words (the title, author, submittor, and
date) with the words given at prompt.
-
#!/bin/bas
etc/modules.conf
echo "DEBUG3: found_driver=$found_driver"
Hope it's help!
Christophe Abrial
LSA France
Systems and Networks Solutions
-Message d'origine-
De : Martin Fluch [mailto:[EMAIL PROTECTED]
Envoye : mardi 2 mai 2000 09:43
A : debian-user@lists.debian.org
Ob
Hi all!
On my woody box I ran into the following problem:
After I had problem with the /etc/init.d/alsa script I started to track
down the problem and finaly ended with the following script, which doesn't
work like I expect:
#!/bin/bash -e
found_driver=0
echo -n "Starting sound dri
> -Original Message-
> From: Michael Talbot-Wilson [SMTP:[EMAIL PROTECTED]
> Sent: Monday, July 26, 1999 4:54 AM
> To: Ben Lutgens
> Cc: debian user list
> Subject: Re: bash scripting
>
> It is bad netiquette to paste part of the man page, becau
1 - 100 of 120 matches
Mail list logo