Re: Bash question hard to formulate

2020-08-03 Thread David Wright
On Mon 03 Aug 2020 at 11:30:42 (+0200), Esteban L wrote: > I am not typing return. I am typing in a sentence...As I receive new > output to the terminal window, and I continue typing, my text stream > just goes down a line. Which is fine, UNLESS I otherwise want to correct > something, and backspa

Re: Bash question hard to formulate

2020-08-03 Thread songbird
wrote: > On Mon, Aug 03, 2020 at 12:47:32AM -0400, songbird wrote: >> ... >>=20 >> i'm not familiar with that problem but another tip >> which is helpful when dealing with a terminal that >> gets into a strange state is to press return then >> type in reset and press return again. > > Typing ret

Re: Bash question hard to formulate

2020-08-03 Thread Esteban L
I think that is the main thing. I am not typing return. I am typing in a sentence...As I receive new output to the terminal window, and I continue typing, my text stream just goes down a line. Which is fine, UNLESS I otherwise want to correct something, and backspacing doesn't word wrap back to th

Re: Bash question hard to formulate

2020-08-03 Thread tomas
On Mon, Aug 03, 2020 at 12:47:32AM -0400, songbird wrote: > ... > > i'm not familiar with that problem but another tip > which is helpful when dealing with a terminal that > gets into a strange state is to press return then > type in reset and press return again. Typing return when you have alr

Re: Bash question hard to formulate

2020-08-02 Thread songbird
... i'm not familiar with that problem but another tip which is helpful when dealing with a terminal that gets into a strange state is to press return then type in reset and press return again. songbird

Re: Bash question hard to formulate

2020-08-02 Thread David Wright
On Sun 02 Aug 2020 at 17:34:07 (+0200), Esteban L wrote: > > I use terminal window/bash quite a bit, and have a quirky behavior on > Debian, at least not on Mac OS terminal window. I think it's just a > default issue, that can be altered -- as I had the exact same problem > years ago -- that I was

Re: Bash question hard to formulate

2020-08-02 Thread Esteban L
Thanks for the tip Andrei! I am not 100% sure it was .bashrc, it could have been some other config file, but I am pretty sure it was bash related. it is unfortunately on a long since gone system. As to my current system, I have just default settings. I have not altered anything. I have only tried

Re: Bash question hard to formulate

2020-08-02 Thread Andrei POPESCU
On Du, 02 aug 20, 17:34:07, Esteban L wrote: > > Last time I had this issue, I remember I had to go into .bashrc and > add/change something. I just don't know what it was. Could it be you changed .inputrc and not .bashrc? Kind regards, Andrei -- http://wiki.debian.org/FAQsFromDebianUser signa

Re: Bash question hard to formulate

2020-08-02 Thread Esteban L
Ah now that I analyze the behavior on a MacOS, I see the thing is this: If I am typing text in, and receive new text, the cursor continues typing. UNLESS I backspace to the beginning of the (current) line, and then it echos the previously typed text. Thanks for the tip! I will try that out. But,

Re: Bash question hard to formulate

2020-08-02 Thread tomas
On Sun, Aug 02, 2020 at 05:34:07PM +0200, Esteban L wrote: > Hello, [...] > Maybe best description is: > > I am tying this senten > > > > ce, and it's fine...but i > > > > I backspace now, as I want to replace the above line "and it's fine" and > what comes after it to change it to "it's n

Re: Bash question hard to formulate

2020-08-02 Thread The Wanderer
On 2020-08-02 at 11:34, Esteban L wrote: > Hello, > > I use terminal window/bash quite a bit, and have a quirky behavior > on Debian, at least not on Mac OS terminal window. I think it's just > a default issue, that can be altered -- as I had the exact same > problem years ago -- that I was able

Re: Bash Question

2017-07-06 Thread Greg Wooledge
On Thu, Jul 06, 2017 at 05:25:05PM +1000, David wrote: > Shells do not set this variable to identify themselves. > On jessie, 'man 1 login', states that it sets SHELL. I understand this to > mean that 'login' exports SHELL as an environment variable to child > processes of 'login'. > > I believe

Re: Bash Question

2017-07-06 Thread Rainer Dorsch
Am Donnerstag, 6. Juli 2017, 11:50:44 CEST schrieb to...@tuxteam.de: > On Thu, Jul 06, 2017 at 09:57:50AM +0100, Darac Marjal wrote: > > On Thu, Jul 06, 2017 at 12:22:29AM +0200, Javier Barroso wrote: > > >Hi, > > > > > >On Wed, Jul 5, 2017 at 11:12 PM, Rainer Dorsch wrote: > > >>Hi, > > >> > > >>

Re: Bash Question

2017-07-06 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, Jul 06, 2017 at 09:57:50AM +0100, Darac Marjal wrote: > On Thu, Jul 06, 2017 at 12:22:29AM +0200, Javier Barroso wrote: > >Hi, > > > >On Wed, Jul 5, 2017 at 11:12 PM, Rainer Dorsch wrote: > >>Hi, > >> > >> > >> > >>can anybody help to explain

Re: Bash Question

2017-07-06 Thread Darac Marjal
On Thu, Jul 06, 2017 at 12:22:29AM +0200, Javier Barroso wrote: Hi, On Wed, Jul 5, 2017 at 11:12 PM, Rainer Dorsch wrote: Hi, can anybody help to explain what is going on here ? rd@mohot:~$ echo $SHELL /bin/bash rd@mohot:~$ if [ "abc" > "dec" ]; then echo bad; fi bad rd@mohot:~$ if [ "

Re: Bash Question

2017-07-06 Thread David
On 6 July 2017 at 07:53, der.hans wrote: > > "$SHELL" is a builtin variable that tells you what shell you're currently > running. No, that's "not accurate", as indeed you wrote later. Shells do not set this variable to identify themselves. This can be easily tested by starting any shell interac

Re: Bash Question

2017-07-05 Thread Jonathan Marquardt
On Wed, Jul 05, 2017 at 10:31:02PM +, der.hans wrote: > Am 06. Jul, 2017 schwätzte Jonathan Marquardt so: > > > On Wed, Jul 05, 2017 at 09:53:15PM +, der.hans wrote: > > > When running the command, your current shell evaluates the variable and > > > replaces it with the variable's value be

Re: Bash Question

2017-07-05 Thread Phil Wyett
On Wed, 2017-07-05 at 23:12 +0200, Rainer Dorsch wrote: > Hi, >   > can anybody help to explain what is going on here ? >   >   > rd@mohot:~$ echo $SHELL  > /bin/bash  > rd@mohot:~$ if [ "abc" > "dec" ]; then echo bad; fi    > bad  > rd@mohot:~$ if [ "abc" < "dec" ]; then echo good; fi  > good 

Re: Bash Question

2017-07-05 Thread der.hans
Am 06. Jul, 2017 schwätzte Jonathan Marquardt so: On Wed, Jul 05, 2017 at 09:53:15PM +, der.hans wrote: When running the command, your current shell evaluates the variable and replaces it with the variable's value before starting the echo command. When echo is run the command has already tu

Re: Bash Question

2017-07-05 Thread Javier Barroso
Hi, On Wed, Jul 5, 2017 at 11:12 PM, Rainer Dorsch wrote: > Hi, > > > > can anybody help to explain what is going on here ? > > > > > > rd@mohot:~$ echo $SHELL > /bin/bash > rd@mohot:~$ if [ "abc" > "dec" ]; then echo bad; fi > bad > rd@mohot:~$ if [ "abc" < "dec" ]; then echo good; fi > good > r

Re: Bash Question

2017-07-05 Thread Jonathan Marquardt
On Wed, Jul 05, 2017 at 09:53:15PM +, der.hans wrote: > When running the command, your current shell evaluates the variable and > replaces it with the variable's value before starting the echo command. > When echo is run the command has already turned into "echo /bin/bash" or > whatever your sh

Re: Bash Question

2017-07-05 Thread der.hans
Am 05. Jul, 2017 schwätzte Rainer Dorsch so: moin moin Rainer, can anybody help to explain what is going on here ? rd@mohot:~$ echo $SHELL Not sure what level you're asking about, so I will cover a couple levels of information. Read the ones that are appropriate :). echo is a a command tha

Re: Bash Question

2017-07-05 Thread Sven Joachim
On 2017-07-05 23:12 +0200, Rainer Dorsch wrote: > Hi, > > can anybody help to explain what is going on here ? > > > rd@mohot:~$ echo $SHELL Without any information how you started your shell, it's hard to tell. For example, xterm version 321 had the bug that it would clear the SHELL variable fro

Re: Bash question: get output as a variable?

2010-02-06 Thread Mart Frauenlob
On 06.02.2010 15:43, Mart Frauenlob wrote: > On 06.02.2010 14:17, Javier Barroso wrote: >> On Fri, Feb 5, 2010 at 7:10 PM, Chris Jackson >> wrote: >>> Dotan Cohen wrote: >>> I'm scripting a backup solution, the line that does the business looks like this: tar -zcvf - * --excl

Re: Bash question: get output as a variable?

2010-02-06 Thread Mart Frauenlob
On 06.02.2010 13:39, Mart Frauenlob wrote: > On 04.02.2010 23:09, Dotan Cohen wrote: >> I'm scripting a backup solution, the line that does the business looks >> like this: >> >> tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | >> dd of=$(hostname)-$(date +%Y%m%d).tbz >> >> Bec

Re: Bash question: get output as a variable?

2010-02-06 Thread Mart Frauenlob
On 06.02.2010 14:17, Javier Barroso wrote: > On Fri, Feb 5, 2010 at 7:10 PM, Chris Jackson > wrote: >> Dotan Cohen wrote: >> >>> I'm scripting a backup solution, the line that does the business looks >>> like this: >>> >>> tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | >>>

Re: Bash question: get output as a variable?

2010-02-06 Thread Javier Barroso
On Fri, Feb 5, 2010 at 7:10 PM, Chris Jackson wrote: > Dotan Cohen wrote: > >> I'm scripting a backup solution, the line that does the business looks >> like this: >> >> tar -zcvf - *  --exclude-from $EXCLUDES  | openssl des3 -salt -k $1 | >> dd of=$(hostname)-$(date +%Y%m%d).tbz >> >> Because of

Re: Bash question: get output as a variable?

2010-02-06 Thread Mart Frauenlob
On 04.02.2010 23:09, Dotan Cohen wrote: > I'm scripting a backup solution, the line that does the business looks > like this: > > tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | > dd of=$(hostname)-$(date +%Y%m%d).tbz > > Because of the "v" flag tar writes to stdout the name

Re: Bash question: get output as a variable?

2010-02-05 Thread Bob McGowan
Ken Teague wrote: > On Fri, Feb 5, 2010 at 10:10 AM, Chris Jackson > wrote: >> Use $() like you do with the date command. You have to redirect stderr back >> to stdout, which means running it in a subshell: >> >> >> FILES=$( ( tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k >> $1

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Fri, Feb 5, 2010 at 12:42 AM, Mart Frauenlob wrote: > tar ... 2> "$filename" > mapfile array1 < "$filename" > > (don't know actually why '-u 2' option for mapfile does not complete for > me? would make it a 'one-liner'.) > > on bash4.0+ This is a great example as well. The only problem is ba

Re: Bash question: get output as a variable?

2010-02-05 Thread Tony Nelson
On 10-02-04 19:06:58, Stephen Powell wrote: > On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: > > In this case output goes to stderr, so: > > > > tar -zcvf - * --exclude-from $EXCLUDES 2> /tmp/data$$ | openssl ... > > Is that something you just have to find out by trial and error?

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Fri, Feb 5, 2010 at 10:10 AM, Chris Jackson wrote: > Use $() like you do with the date command. You have to redirect stderr back > to stdout, which means running it in a subshell: > > > FILES=$( ( tar -zcvf - *  --exclude-from $EXCLUDES  | openssl des3 -salt -k > $1 | dd of=$(hostname)-$(date +

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Fri, Feb 5, 2010 at 7:44 AM, bruno wrote: > because it's a simplier way to get the list into a variable Can you please explain how it's simpler. The method I suggested certainly isn't as easy, but the method I suggested merely showed a detailed example. Others here are coming up with 1 or 2

Re: Bash question: get output as a variable?

2010-02-05 Thread Brian Ryans
Quoting Stephen Powell on 2010-02-04 18:06:58: > but in the general case, it's hard to tell. Since stdout and > stderr both default to the terminal, and since the doc doesn't > say, how else would you know other than by trial and error? Trial and error is an effective way to figure it out. [1] De

Re: Bash question: get output as a variable?

2010-02-05 Thread Boyd Stephen Smith Jr.
On Friday 05 February 2010 10:01:45 Paul E Condon wrote: > Traditional Unix and traditional C both made provision for stdin, > stdout, and stderr. When Stroustrup, et al., started working on C++ > and its earlier predicessors, someone recognized the need for a fourth > stdXXX, namely stdlog. If yo

Re: Bash question: get output as a variable?

2010-02-05 Thread Chris Jackson
Dotan Cohen wrote: I'm scripting a backup solution, the line that does the business looks like this: tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | dd of=$(hostname)-$(date +%Y%m%d).tbz Because of the "v" flag tar writes to stdout the name of each file copied. How can I

Re: Bash question: get output as a variable?

2010-02-05 Thread Bob McGowan
Dotan Cohen wrote: > I'm scripting a backup solution, the line that does the business looks > like this: > > tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | > dd of=$(hostname)-$(date +%Y%m%d).tbz > > Because of the "v" flag tar writes to stdout the name of each file > copie

Re: Bash question: get output as a variable?

2010-02-05 Thread Bob McGowan
Dotan Cohen wrote: > I'm scripting a backup solution, the line that does the business looks > like this: > > tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | > dd of=$(hostname)-$(date +%Y%m%d).tbz > > Because of the "v" flag tar writes to stdout the name of each file > copie

Re: Bash question: get output as a variable?

2010-02-05 Thread Paul E Condon
On 20100205_135919, Alexey Salmin wrote: > On Fri, Feb 5, 2010 at 1:20 PM, Javier Barroso wrote: > > On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell wrote: > >> On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: > >>> In this case output goes to stderr, so: > >>> > >>> tar -zcvf - * --

Re: Bash question: get output as a variable?

2010-02-05 Thread bruno
Ken Teague wrote: On Fri, Feb 5, 2010 at 12:39 AM, bruno wrote: Why not simply use the t option for content listing : tar tvf * --exclude-from $EXCLUDES He's already creating the archive with -v. Why process the archive a 2nd time just to get a listing when it comes from stdout th

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Fri, Feb 5, 2010 at 12:39 AM, bruno wrote: > Why not simply use the  t option for content listing : > > tar tvf  * --exclude-from $EXCLUDES He's already creating the archive with -v. Why process the archive a 2nd time just to get a listing when it comes from stdout the 1st time? -- To UNSUB

Re: Bash question: get output as a variable?

2010-02-05 Thread Stephen Powell
On Fri, 5 Feb 2010 02:20:48 -0500 (EST), Javier Barroso wrote: > If you are using stdout as tar output, including filenames there will > corrupt that output, so it is logical that in this case filenames goes > to stderr. That does make sense, now that I think about it. I didn't look closely enoug

Re: Bash question: get output as a variable?

2010-02-05 Thread Mart Frauenlob
On 05.02.2010 09:07, Ken Teague wrote: > On Thu, Feb 4, 2010 at 2:09 PM, Dotan Cohen wrote: >> I'm scripting a backup solution, the line that does the business looks >> like this: >> >> tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | >> dd of=$(hostname)-$(date +%Y%m%d).tbz >

Re: Bash question: get output as a variable?

2010-02-05 Thread bruno
Ken Teague wrote: On Thu, Feb 4, 2010 at 2:09 PM, Dotan Cohen wrote: I'm scripting a backup solution, the line that does the business looks like this: tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | dd of=$(hostname)-$(date +%Y%m%d).tbz Because of the "v" flag tar wri

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Thu, Feb 4, 2010 at 2:09 PM, Dotan Cohen wrote: > I'm scripting a backup solution, the line that does the business looks > like this: > > tar -zcvf - *  --exclude-from $EXCLUDES  | openssl des3 -salt -k $1 | > dd of=$(hostname)-$(date +%Y%m%d).tbz > > Because of the "v" flag tar writes to stdou

Re: Bash question: get output as a variable?

2010-02-05 Thread Alexey Salmin
On Fri, Feb 5, 2010 at 1:20 PM, Javier Barroso wrote: > On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell wrote: >> On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: >>> In this case output goes to stderr, so: >>> >>> tar -zcvf - * --exclude-from $EXCLUDES 2> /tmp/data$$ | openssl ... >

Re: Bash question: get output as a variable?

2010-02-04 Thread Javier Barroso
On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell wrote: > On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: >> In this case output goes to stderr, so: >> >> tar -zcvf - * --exclude-from $EXCLUDES 2> /tmp/data$$ | openssl ... > > Is that something you just have to find out by trial and e

Re: Bash question: get output as a variable?

2010-02-04 Thread Stephen Powell
On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: > In this case output goes to stderr, so: > > tar -zcvf - * --exclude-from $EXCLUDES 2> /tmp/data$$ | openssl ... Is that something you just have to find out by trial and error? I checked the man page for tar, and there's nothing in t

Re: Bash question: get output as a variable?

2010-02-04 Thread Javier Barroso
On Thu, Feb 4, 2010 at 11:32 PM, Stephen Powell wrote: > On Thu, 4 Feb 2010 17:09:28 -0500 (EST), Dotan Cohen wrote: >> I'm scripting a backup solution, the line that does the business looks >> like this: >> >> tar -zcvf - *  --exclude-from $EXCLUDES  | openssl des3 -salt -k $1 | >> dd of=$(hostna

Re: Bash question: get output as a variable?

2010-02-04 Thread Stephen Powell
On Thu, 4 Feb 2010 17:09:28 -0500 (EST), Dotan Cohen wrote: > I'm scripting a backup solution, the line that does the business looks > like this: > > tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | > dd of=$(hostname)-$(date +%Y%m%d).tbz > > Because of the "v" flag tar write

Re: Bash question: get output as a variable?

2010-02-04 Thread Alex Samad
On Fri, Feb 05, 2010 at 12:09:28AM +0200, Dotan Cohen wrote: > I'm scripting a backup solution, the line that does the business looks > like this: > > tar -zcvf - * --exclude-from $EXCLUDES | openssl des3 -salt -k $1 | > dd of=$(hostname)-$(date +%Y%m%d).tbz > > Because of the "v" flag tar writ

Re: bash question

2009-10-10 Thread Alex Samad
On Sat, Oct 10, 2009 at 07:45:14AM -0400, Antonio Perez wrote: > Alex Samad wrote: > > > Hi, i have this: > > > RDSCHM="--remote-schema 'ssh -i /root/.ssh/id_backup -C %s rdiff-backup > > --server'" > > > and trying this > > > > rdiff-backup \ > > $RDSCHM \ > > $RDRM \ > > "$DEST/" > > > wit

Re: bash question

2009-10-10 Thread green
Boyd Stephen Smith Jr. wrote at 2009-10-10 01:21 -0500: > You can also force your to work correctly under dash / sh, but you'll have to > understand how to use eval, which can get a bit tricky. It would look > something like this: I second the eval suggestion, it has helped me several times to

Re: bash question

2009-10-10 Thread Antonio Perez
Alex Samad wrote: > Hi, i have this: > RDSCHM="--remote-schema 'ssh -i /root/.ssh/id_backup -C %s rdiff-backup > --server'" > and trying this > > rdiff-backup \ > $RDSCHM \ > $RDRM \ > "$DEST/" > with sh -x i get this > + rdiff-backup --remote-schema ''\''ssh' -i /root/.ssh/id_backup -C %s

Re: bash question

2009-10-10 Thread Alex Samad
On Sat, Oct 10, 2009 at 01:21:30AM -0500, Boyd Stephen Smith Jr. wrote: > In <20091010042217.gd2...@samad.com.au>, Alex Samad wrote: > >Hi > > > >i have this > > > >RDSCHM="--remote-schema 'ssh -i /root/.ssh/id_backup -C %s > >rdiff-backup --server'" > > > > > >and trying this > > > >rdiff-backup

Re: bash question

2009-10-09 Thread Boyd Stephen Smith Jr.
In <20091010042217.gd2...@samad.com.au>, Alex Samad wrote: >Hi > >i have this > >RDSCHM="--remote-schema 'ssh -i /root/.ssh/id_backup -C %s >rdiff-backup --server'" > > >and trying this > >rdiff-backup \ > $RDSCHM \ > $RDRM \ > "$DEST/" Sorry, there's no clean, portable way to

Re: Bash question

2003-07-02 Thread matt zagrabelny
beating this to death: #!/bin/bash IFS=" " for file in $(ls -1); do echo ">>""$file""<<" done cheers, -matt zagrabelny -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Re: Bash question

2003-07-02 Thread Jon Haugsand
* Shawn Lamson > > for file in `ls` > do mpg123 "$file" > done Really? $ touch "aa aa" $ touch bb $ for file in `ls`; do echo "$file"; done aa aa bb -- Jon Haugsand, [EMAIL PROTECTED] http://www.norges-bank.no -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe".

Re: Bash question

2003-07-02 Thread Jamin W. Collins
On Tue, Jul 01, 2003 at 06:52:26PM +0100, Colin Watson wrote: > On Tue, Jul 01, 2003 at 07:43:28AM -0600, Jamin W. Collins wrote: > > > This has been asked and answered a few times in the past. There are > > several ways to do it. Here is one: > > > >#!/bin/sh > >IFS=$'\n' > > > >f

Re: Bash question

2003-07-01 Thread Kevin McKinley
On Tue, 1 Jul 2003 15:41:56 +0100 Hugh Saunders <[EMAIL PROTECTED]> wrote: > On Tue, Jul 01, 2003 at 10:28:32AM -0400, David Z Maze wrote: > > ITYM 'for file in *'... > > ISTR earlier versions... > flip man! i needed two references to `dict` to read your email. > Guess i should learn some acronyms

Re: Bash question

2003-07-01 Thread Richard Heycock
ls | while read file do cat "$bob" done for loops treat spaces and newlines the same (which is what you are seeing), the read command reads till the end of the line including spaces. Note that when you use the environment variable you must quote it (be sure to use " as opposed to '). If y

Re: Bash question

2003-07-01 Thread Alfredo Valles
On Tuesday 01 July 2003 9:46 am, Stephan Sauerburger wrote: > How do I have it make sure it iterates file-by-file? The following example, > to play all mp3s in the current directory: > > for file in `ls` > do > mpg123 $file > done > > ...will do just a fine job, so long as none of the file names

Re: Bash question

2003-07-01 Thread Colin Watson
On Tue, Jul 01, 2003 at 02:04:35PM +0200, Alfredo Valles wrote: > On Tuesday 01 July 2003 3:18 pm, Colin Watson wrote: > > There's one mistake in the above even before looking at the contents of > > "#stuff", namely that you shouldn't be using ls here. Have a look at > > this document written by a

Re: Bash question

2003-07-01 Thread Alfredo Valles
On Tuesday 01 July 2003 3:18 pm, Colin Watson wrote: > There's one mistake in the above even before looking at the contents of > "#stuff", namely that you shouldn't be using ls here. Have a look at > this document written by a friend of mine: > http://www.greenend.org.uk/rjk/2001/04/shell.html

Re: Bash question

2003-07-01 Thread Colin Watson
On Tue, Jul 01, 2003 at 07:43:28AM -0600, Jamin W. Collins wrote: > On Tue, Jul 01, 2003 at 02:46:58AM -0500, Stephan Sauerburger wrote: > > So how can one have the for loop separate the elements of the list > > only by newlines ("\n"), filling the contents of "file" with the > > whole line, and no

Re: Bash question

2003-07-01 Thread Lukas Ruf
Jon Haugsand <[EMAIL PROTECTED]> [2003-07-01 19:43]: in your directory. > > A very failsafe variant is to use find: > > find . -type f -print0 | xargs -0 mpg123 I usually make use of find's parameter -maxdepth level if you would like to restrict the search to a certain depth of the directory

Re: Bash question

2003-07-01 Thread Johannes Zarl
> for file in *.ogg; do > ogg123 "$file" > done > > (Since the double-quotes allow variable expansion, but force the > result to be a single "world" for shell purposes.) To deal with all (im)possible filenames, you could even do: for file in *.ogg do ogg123 -- "$file" done Just in case

Re: Bash question

2003-07-01 Thread Hugh Saunders
On Tue, Jul 01, 2003 at 10:28:32AM -0400, David Z Maze wrote: > ITYM 'for file in *'... > ISTR earlier versions... flip man! i needed two references to `dict` to read your email. Guess i should learn some acronyms! -- hugh pgp0.pgp Description: PGP signature

Re: Bash question

2003-07-01 Thread thomas . gies
Hi. Try find. It has the -exec parameter. That is what you want. -- Die Welt ist kunterbunt, mein Arsch wiegt 180 Pfund. - Hans Peter Gies, 1989 pgp0.pgp Description: PGP signature

Re: Bash question

2003-07-01 Thread Jon Haugsand
* Stephan Sauerburger > This is a general shell-scripting question: > > In a for loop which runs through all files, as in: > > for file in `ls` > do > #stuff > done > > How do I have it make sure it iterates file-by-file? The following example, to play > all > mp3s in the current directory: > >

Re: Bash question

2003-07-01 Thread Shawn Lamson
On Tue, July 01 at 2:46 AM EDT Stephan Sauerburger <[EMAIL PROTECTED]> wrote: >So how can one have the for loop separate the elements of the list only >by newlines ("\n"), filling the contents of "file" with the whole line, >and not separate by spaces, tabs, or other white space? You'll probably

Re: Bash question

2003-07-01 Thread Jamin W. Collins
On Tue, Jul 01, 2003 at 02:46:58AM -0500, Stephan Sauerburger wrote: > So how can one have the for loop separate the elements of the list only by > newlines ("\n"), filling the contents of "file" with the whole line, > and not separate by spaces, tabs, or other white space? This has been asked an

Re: Bash question

2003-07-01 Thread Colin Watson
On Tue, Jul 01, 2003 at 02:46:58AM -0500, Stephan Sauerburger wrote: > This is a general shell-scripting question: > > In a for loop which runs through all files, as in: > > for file in `ls` > do > #stuff > done > > How do I have it make sure it iterates file-by-file? There's one mistake in th

Re: Bash question

2003-07-01 Thread Andrew Perrin
Use either ls -b (quote nongraphic characters) or ls -Q (enclose in double quotes) for passing the files to the shell. ap -- Andrew J Perrin - http://www.unc.edu/~aperrin Assistant Professor of Sociology, U of North Carolina, Cha

Re: Bash question

2003-07-01 Thread David Z Maze
Stephan Sauerburger <[EMAIL PROTECTED]> writes: > In a for loop which runs through all files, as in: > > for file in `ls` > do > #stuff > done ITYM 'for file in *'... > ...will do just a fine job, so long as none of the file names have any > spaces in them. because it gets around this. In ge

Re: bash question: reporting a variable named within a variable

2003-04-04 Thread Rob Sims
On Thursday 03 April 2003 08:01 pm, Bob Proulx wrote: > Craig Dickson wrote: > > echo $var=$(eval echo \$$var) > > That works. Personally I prefer to eval the entire line. This way > you only use one layer of processing rather than the two in the above. > > for var in FOO BLAH ; do >

Re: bash question: reporting a variable named within a variable

2003-04-04 Thread Corey Hickey
Indeed, eval did the trick, exactly what I wanted to do. Thanks to all who responded, you were most helpful. -Corey -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Colin Watson
On Fri, Apr 04, 2003 at 12:34:33AM +0100, Colin Watson wrote: > On Thu, Apr 03, 2003 at 01:58:35PM -0800, Corey Hickey wrote: > > #!/bin/bash > > > > FOO=bar > > BLAH=blarg > > > > for var in FOO BLAH ; do > > echo $var = $"$var" #this part is messed up > > done > > Try this, which I believe

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Bob Proulx
Craig Dickson wrote: > echo $var=$(eval echo \$$var) That works. Personally I prefer to eval the entire line. This way you only use one layer of processing rather than the two in the above. for var in FOO BLAH ; do eval echo $var = \$$var; done For those following this scripting di

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Colin Watson
On Thu, Apr 03, 2003 at 01:58:35PM -0800, Corey Hickey wrote: > This isn't exactly a debian-specific question, but I'm not sure where > else to turn. > > I'm writing a bash script wherein I have a list of variables of which I > want to return the values. A script representative of what I am trying

Re: bash question: reporting a variable named within a variable

2003-04-03 Thread Craig Dickson
Corey Hickey wrote: > I'm writing a bash script wherein I have a list of variables of which I > want to return the values. A script representative of what I am trying > to do would be like this: > > > #!/bin/bash > > FOO=bar > BLAH=blarg > > for var in FOO BLAH ; do > echo $var = $"$var"

Re: BASH question

2002-02-20 Thread Viktor Rosenfeld
Karl E. Jorgensen wrote: > With "kill -9", there is no way the shell can catch it. It's a bit of a > shotgun approach to getting rid of the process (man 7 signal). > > However, if you were to settle for the normal kill (= SIGTERM), then you > should be OK: > #!/bin/sh > > echo -n "Doing

Re: BASH question

2002-02-20 Thread Karl E. Jorgensen
On Tue, Feb 19, 2002 at 05:42:35PM +0100, Viktor Rosenfeld wrote: > Hi, > > I have the following bash question. I've written a script that makes > sure that I'm online (ISDN dial-on-demand) and then gets mail with > fetchmail. He're the code that makes sure I'm connected and prints dots > while

Re: bash question.

2002-02-07 Thread Ron Johnson
On Thu, 7 Feb 2002 15:49:25 +0200 (EET) "Petrov M.I." <[EMAIL PROTECTED]> wrote: > Hi All. > > > How do you _read_ from the printer, which is an output device? > > Are you trying to get status info back from the printer? > Yes. I want to get status info. When I do `echo -e "..."' then > `cat /de

Re: bash question.

2002-02-07 Thread Petrov M.I.
Hi All. > How do you _read_ from the printer, which is an output device? > Are you trying to get status info back from the printer? Yes. I want to get status info. When I do `echo -e "..."' then `cat /dev/lp0' from command line, this work correctly. When I do from script this do not work. > You

Re: bash question.

2002-02-06 Thread Ron Johnson
On Wed, 6 Feb 2002 20:30:47 +0200 (EET) "Petrov M.I." <[EMAIL PROTECTED]> wrote: > Hi All. > I write small script: > #!/bin/bash > echo -e "...PJL commands..." | cat > /dev/lp0 Try adding a newline: echo -e "...PJL commands...\n" | cat > /dev/lp0 > cat /dev/lp0 ??? > When I try it run I g

Re: bash question: identify line number of function call

2001-09-14 Thread Andras BALI
On Fri, Sep 14, 2001 at 05:28:35PM +0200, Martin F Krafft wrote: > in bash, is it possible to identify the line number of a script, from > where a function has been called? You have $LINENO, but it restarts counting from 1 in functions. But if you invoke the function with $LINENO as argument, the

Re: BASH question

2001-05-12 Thread Henrik Enberg
"Karsten M. Self" : > You could also look at some standard installer scripts...trying to think > of one off the top of my head. None are floating up that aren't > attached to some monster applications -- DB/2's installer comes to mind, > but that's a pretty hefty download.. Mayby xmcd.. Henrik

Re: BASH question

2001-05-12 Thread Karsten M. Self
on Fri, May 11, 2001 at 03:06:07AM -0400, Sunny Dubey ([EMAIL PROTECTED]) wrote: > Hey, > > Anyone know where I might find info about using BASH to create an > installer for a application? something that would just ask the person > various questions, and use that info to create config files and w

Re: bash-question

2000-12-26 Thread Carel Fellinger
On Tue, Dec 26, 2000 at 11:55:13AM +0100, Stephan Kulka wrote: > > > > > On Mon, Dec 25, 2000 at 10:21:52AM +0100, Stephan Kulka wrote: > > > That's quite a newbie question, but I don't know what to do. > > > Yesterday I made a new directory for programming, I added this directory > > > with exp

Re: bash-question

2000-12-26 Thread Stephan Kulka
> On Mon, Dec 25, 2000 at 10:21:52AM +0100, Stephan Kulka wrote: > > That's quite a newbie question, but I don't know what to do. > > Yesterday I made a new directory for programming, I added this directory > > with export to my PATH. Yesterday everything went fine, but today I always > > get th

Re: bash-question

2000-12-25 Thread Carel Fellinger
On Mon, Dec 25, 2000 at 10:21:52AM +0100, Stephan Kulka wrote: > That's quite a newbie question, but I don't know what to do. > Yesterday I made a new directory for programming, I added this directory > with export to my PATH. Yesterday everything went fine, but today I always > get the error comma

Re: bash-question

2000-12-25 Thread W. Paul Mills
[EMAIL PROTECTED] (Stephan Kulka) writes: I do not think your PATH is really set. How did you check your path? Did you "echo $PATH" to verify? > That's quite a newbie question, but I don't know what to do. > Yesterday I made a new directory for programming, I added this directory > with export

Re: Bash question

2000-02-09 Thread Paolo Pedaletti
Ciao Andreas Sliwka, > where or whom should I ask not-so-easy bash questions? news:comp.unix.shell Ciao -- Paolo Pedaletti, Como, ITALYa [EMAIL PROTECTED]

Re: bash question

1999-02-22 Thread E.L. Meijer \(Eric\)
> > Thanks Eric, > I tried sourcing scr2 and it works faster then CALLING scr2. > This is to be expected: if you call a script, separate shell is started that runs it. This takes some time. If you source a script, the only overhead is opening and reading an extra file. Eric -- E.L. Meijer

Re: bash question

1999-02-22 Thread Eugene Sevinian
Thanks Eric, I tried sourcing scr2 and it works faster then CALLING scr2. Eugene. On Mon, 22 Feb 1999, E.L. Meijer (Eric) wrote: > > > > Hi ppl, > > As far as I did not find the answer in bash manual, I hope that > > someone can help me here. Let say I have two bash scripts and I need the > >

Re: bash question

1999-02-22 Thread E.L. Meijer \(Eric\)
> > Hi ppl, > As far as I did not find the answer in bash manual, I hope that > someone can help me here. Let say I have two bash scripts and I need the > parameter which is set in scr2 to be visable in scr1. > > scr1: > #!/bin/sh > export LANG=lang1 > echo "LANG is $LANG in $

Re: Bash question/problem.

1998-12-18 Thread Mitch Blevins
Jim Lynch wrote: > I'v been fighting a bash problem since I first installed bo. I figured > it was a bug in bash, but I've now upgraded (partially) to hamm and I've > still got it. I'm running > > ii bash2.01.1-4 The GNU Bourne Again SHell > > I'm trying to get my command re

RE: BASH question

1998-02-16 Thread Fulgham, Brent/SCO
For those who are interested, my BASH problems were due to the presence of some control characters in the script file. I was using the "ae" editor, which in its latest incarnation was inserting a "^M" at the end of each line to signify a carriage return. Once I switched to vi I could see the char

Re: BASH question

1998-02-16 Thread Daniel Mashao
On Fri, 13 Feb 1998, Fulgham, Brent/SCO wrote: > Can anyone tell me why I can't generate working Bash scripts? > > For example, I want to create a short script called "print" so that I > can do some formatted printing: > > #!/bin/sh > # Print -- formatted printer tool to get a 5-space margin and

  1   2   >