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

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

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

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

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

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

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

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.

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

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

Bash question hard to formulate

2020-08-02 Thread Esteban L
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 to resolve, which I again turns up. I forgot the

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: > >

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

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

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

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

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

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

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

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

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

Bash Question

2017-07-05 Thread Rainer Dorsch
Hi, can anybody help to explain what is going on here ? rd@mohot:~$ echo $SHELL Thanks Rainer -- Rainer Dorsch http://bokomoko.de/

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 13:53:14 Thomas Schmitt wrote: > Hi, > > > ++ /usr/bin/inotifywait -q -e close --format %f /var/spool/mail/ > > From the man page i learn that you let it watch the whole directory. > This way you get notifications about any file in there. > > The empty variable content

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 10:08:33 David Wright wrote: > On Mon 13 Jun 2016 at 10:19:46 (+0200), Thomas Schmitt wrote: > > Gene Heskett wrote: > > > if test ${InMail} = "gene" > > > bin/mailwatcher: line 66: test: =: unary operator expected > > > > The syntax problem is most probably about missing

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 08:50:58 Jörg-Volker Peetz wrote: > watch -d -n 1.5  ls -la /var/spool/mail/ Interesting tool, thank you. Cheers, Gene Heskett -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author)

Re: nother bash question

2016-06-13 Thread Thomas Schmitt
Hi, > ++ /usr/bin/inotifywait -q -e close --format %f /var/spool/mail/ >From the man page i learn that you let it watch the whole directory. This way you get notifications about any file in there. The empty variable content possibly stems from this feature: "-format ... %f When an

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 06:34:00 Gene Heskett wrote: > On Monday 13 June 2016 05:21:23 to...@tuxteam.de wrote: > > On Mon, Jun 13, 2016 at 10:19:46AM +0200, Thomas Schmitt wrote: > > > Hi, > > > > > > Gene Heskett wrote: > > > > if test ${InMail} = "gene" > > > > bin/mailwatcher: line 66: test: =:

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 06:30:39 Thomas Schmitt wrote: > Hi, > > i wrote: > > > Is ${InMail} supposed to be empty ? It is not supposed to be. Empty only if I kill it with a killall in practice. > > Gene Heskett wrote: > > That is set by inotifywait's return of the name of the file that > >

Re: nother bash question

2016-06-13 Thread Thomas Schmitt
Hi, David Wright wrote: > Thomas, your patience appears unbounded. That's a character strength which a programmer must have at least in part. > https://lists.debian.org/debian-user/2016/04/msg00652.html Yeah. I advised Gene to put "-quotes around variable evaluations. Now we have the

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 05:21:23 to...@tuxteam.de wrote: > On Mon, Jun 13, 2016 at 10:19:46AM +0200, Thomas Schmitt wrote: > > Hi, > > > > Gene Heskett wrote: > > > if test ${InMail} = "gene" > > > bin/mailwatcher: line 66: test: =: unary operator expected > > > > The syntax problem is most

Re: nother bash question

2016-06-13 Thread David Wright
On Mon 13 Jun 2016 at 05:17:42 (-0400), Gene Heskett wrote: > On Monday 13 June 2016 04:19:46 Thomas Schmitt wrote: > > > Hi, > > > > Gene Heskett wrote: > > > if test ${InMail} = "gene" > > > bin/mailwatcher: line 66: test: =: unary operator expected > > > > The syntax problem is most probably

Re: nother bash question

2016-06-13 Thread David Wright
On Mon 13 Jun 2016 at 10:19:46 (+0200), Thomas Schmitt wrote: > Gene Heskett wrote: > > if test ${InMail} = "gene" > > bin/mailwatcher: line 66: test: =: unary operator expected > > The syntax problem is most probably about missing "-quotes around > the variable ecaluation ${InMail} which would

Re: nother bash question

2016-06-13 Thread Jörg-Volker Peetz
Gene Heskett wrote on 06/13/16 12:34: > In any event a pair of "" around the left argument silenced the warning, > and it still works. However it may be that inotifywait is premature, as > I see that InMail occasionall contains a hash name of the order of: > + test _KQG,TdoXXB.coyote = gene > +

Re: nother bash question

2016-06-13 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Jun 13, 2016 at 12:30:39PM +0200, Thomas Schmitt wrote: > Hi, [...] > to...@tuxteam.de wrote: > > One could argue "unary operator expected" is a strange way to > > restate this. > > It's the way how the gild of land surveyors and bean

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 05:21:23 to...@tuxteam.de wrote: > On Mon, Jun 13, 2016 at 10:19:46AM +0200, Thomas Schmitt wrote: > > Hi, > > > > Gene Heskett wrote: > > > if test ${InMail} = "gene" > > > bin/mailwatcher: line 66: test: =: unary operator expected > > > > The syntax problem is most

Re: nother bash question

2016-06-13 Thread Thomas Schmitt
Hi, i wrote: > > Is ${InMail} supposed to be empty ? Gene Heskett wrote: > That is set by inotifywait's return of the name of the file that procmail > just closed. Hmm. I don't have inotifywait installed. According to http://linux.die.net/man/1/inotifywait it should put out lines like

Re: nother bash question

2016-06-13 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Jun 13, 2016 at 10:19:46AM +0200, Thomas Schmitt wrote: > Hi, > > Gene Heskett wrote: > > if test ${InMail} = "gene" > > bin/mailwatcher: line 66: test: =: unary operator expected > > The syntax problem is most probably about missing

Re: nother bash question

2016-06-13 Thread Gene Heskett
On Monday 13 June 2016 04:19:46 Thomas Schmitt wrote: > Hi, > > Gene Heskett wrote: > > if test ${InMail} = "gene" > > bin/mailwatcher: line 66: test: =: unary operator expected > > The syntax problem is most probably about missing "-quotes around > the variable ecaluation ${InMail} which would

Re: nother bash question

2016-06-13 Thread Thomas Schmitt
Hi, Gene Heskett wrote: > if test ${InMail} = "gene" > bin/mailwatcher: line 66: test: =: unary operator expected The syntax problem is most probably about missing "-quotes around the variable ecaluation ${InMail} which would have to be empty to cause the message: $ test $notdefined = "hello

nother bash question

2016-06-13 Thread Gene Heskett
Greetings bashers; I have a set -x at the top of this script, and this line, while working as expected: if test ${InMail} = "gene" also spits out this warning: bin/mailwatcher: line 66: test: =: unary operator expected What syntax correction does this need? Thanks. Cheers, Gene Heskett --

perl/bash question - html link out of text

2010-03-07 Thread Vadkan Jozsef
I don't know how to modify the: sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' command, to not just: $ echo test string http://somewhere.uk/ test | sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' a href=http://somewhere.uk/;http://somewhere.uk//a rather output this: test string a

Re: perl/bash question - html link out of text

2010-03-07 Thread Kumar Appaiah
On Sun, Mar 07, 2010 at 06:07:56PM +0100, Vadkan Jozsef wrote: I don't know how to modify the: sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' command, to not just: $ echo test string http://somewhere.uk/ test | sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' a

Re: perl/bash question - html link out of text

2010-03-07 Thread Kumar Appaiah
On Sun, Mar 07, 2010 at 11:12:39AM -0600, Kumar Appaiah wrote: On Sun, Mar 07, 2010 at 06:07:56PM +0100, Vadkan Jozsef wrote: I don't know how to modify the: sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' command, to not just: $ echo test string http://somewhere.uk/ test | sed -r

Re: perl/bash question - html link out of text

2010-03-07 Thread Boyd Stephen Smith Jr.
On Sunday 07 March 2010 11:07:56 Vadkan Jozsef wrote: I don't know how to modify the: sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' command, to not just: $ echo test string http://somewhere.uk/ test | sed -r 's,.*(http://[^ \$]+).*,a href=\\1\\1/a,' a

Re: perl or bash question [convert strings in a txt to html links]

2010-02-28 Thread Jari Fredriksson
On 27.2.2010 19:12, Vadkan Jozsef wrote: How can I do that in bash or perl, that I have a txt file, e.g.: $cat file.txt Hi, this is the content of the txt file, that contains links like this: http://www.somewhere.it/, and it could contain: http://somewhere.com, etc.. This is the second

perl or bash question [convert strings in a txt to html links]

2010-02-27 Thread Vadkan Jozsef
How can I do that in bash or perl, that I have a txt file, e.g.: $cat file.txt Hi, this is the content of the txt file, that contains links like this: http://www.somewhere.it/, and it could contain: http://somewhere.com, etc.. This is the second line, that doesn't contains links.. .. This is the

Re: perl or bash question [convert strings in a txt to html links]

2010-02-27 Thread Kelly Clowers
On Sat, Feb 27, 2010 at 09:12, Vadkan Jozsef jozsi.avad...@gmail.com wrote: How can I do that in bash or perl, that I have a txt file, e.g.: $cat file.txt Hi, this is the content of the txt file, that contains links like this: http://www.somewhere.it/, and it could contain:

Re: perl or bash question [convert strings in a txt to html links]

2010-02-27 Thread Tony van der Hoff
On 27/02/10 17:12, Vadkan Jozsef wrote: How can I do that in bash or perl, that I have a txt file, e.g.: $cat file.txt Hi, this is the content of the txt file, that contains links like this: http://www.somewhere.it/, and it could contain: http://somewhere.com, etc.. This is the second line,

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 of each

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 c.jack...@shadowcat.co.uk 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

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 c.jack...@shadowcat.co.uk 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

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 Because of the v

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 c.jack...@shadowcat.co.uk wrote: Dotan Cohen wrote: I'm scripting a backup solution, the line that does the business looks like this: tar -zcvf - *

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 javibarr...@gmail.com wrote: On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell zlinux...@wowway.com 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

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 dotanco...@gmail.com 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

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 dotanco...@gmail.com 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-05 Thread Mart Frauenlob
On 05.02.2010 09:07, Ken Teague wrote: On Thu, Feb 4, 2010 at 2:09 PM, Dotan Cohen dotanco...@gmail.com 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

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 enough.

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Fri, Feb 5, 2010 at 12:39 AM, bruno bruno.deb...@cyberoso.com 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

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 bruno.deb...@cyberoso.com 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

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 javibarr...@gmail.com wrote: On Fri, Feb 5, 2010 at 1:06 AM, Stephen Powell zlinux...@wowway.com wrote: On Thu, 4 Feb 2010 17:42:45 -0500 (EST), Javier Barroso wrote: In this case output goes to stderr,

[OT] - Bash question: get output as a variable?

2010-02-05 Thread Stephen Powell
On Fri, 5 Feb 2010 10:44:28 -0500 (EST), bruno wrote: Ken Teague wrote: On Fri, Feb 5, 2010 at 12:39 AM, bruno bruno.deb...@cyberoso.com wrote: Why not simply use the t option for content listing : tar tvf * --exclude-from $EXCLUDES He's already creating the archive with -v.

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread John Hasler
Stephen Powell writes: I wish the shell supported multi-stream pipelines. I think you could fake it with tee and a fifo. -- John Hasler -- To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Bob McGowan
Stephen Powell wrote: On Fri, 5 Feb 2010 10:44:28 -0500 (EST), bruno wrote: Ken Teague wrote: On Fri, Feb 5, 2010 at 12:39 AM, bruno bruno.deb...@cyberoso.com wrote: Why not simply use the t option for content listing : tar tvf * --exclude-from $EXCLUDES He's already creating

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 copied. How

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 copied. How

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Stephen Powell
On Fri, 5 Feb 2010 11:39:26 -0500 (EST), John Hasler wrote: Stephen Powell writes: I wish the shell supported multi-stream pipelines. I think you could fake it with tee and a fifo. Well, I know about tee; but, although I've heard the term fifo, I know nothing about it in a Linux/Unix/shell

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 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 you

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]

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Stephen Powell
On Fri, 5 Feb 2010 12:42:47 -0500 (EST), Bob McGowan wrote: Stephen Powell wrote: This is off topic from the OP's question, but one of the things that I miss in the Linux environment that I used to use a lot in the CMS environment is CMS Pipelines. The shell supports pipelines, but they are

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Boyd Stephen Smith Jr.
On Friday 05 February 2010 14:47:21 Stephen Powell wrote: On Fri, 5 Feb 2010 12:42:47 -0500 (EST), Bob McGowan wrote: Let me give you a simple example of a CMS pipeline for illustrative purposes, so that you will get some idea of what I'm talking about. [snip: Long, but very useful

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Bob McGowan
Boyd Stephen Smith Jr. wrote: On Friday 05 February 2010 14:47:21 Stephen Powell wrote: On Fri, 5 Feb 2010 12:42:47 -0500 (EST), Bob McGowan wrote: Let me give you a simple example of a CMS pipeline for illustrative purposes, so that you will get some idea of what I'm talking about.

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Boyd Stephen Smith Jr.
On Friday 05 February 2010 16:33:12 Bob McGowan wrote: Boyd Stephen Smith Jr. wrote: mkfifo LOCM mkfifo FIN ( | NFIND | LOCATE 2 LOCM | FANINANY 2 FIN| LOCATE LOCM FIN wait ) which would disallow having the parallel processing implied by the above diagram.

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Bob McGowan
Boyd Stephen Smith Jr. wrote: On Friday 05 February 2010 16:33:12 Bob McGowan wrote: Boyd Stephen Smith Jr. wrote: mkfifo LOCM mkfifo FIN ( | NFIND | LOCATE 2 LOCM | FANINANY 2 FIN| LOCATE LOCM FIN wait ) which would disallow having the parallel processing implied by

Re: Bash question: get output as a variable?

2010-02-05 Thread Ken Teague
On Fri, Feb 5, 2010 at 7:44 AM, bruno bruno.deb...@cyberoso.com 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

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 c.jack...@shadowcat.co.uk 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

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? I

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 mart.frauen...@chello.at 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

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 c.jack...@shadowcat.co.uk 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

Re: [OT] - Bash question: get output as a variable?

2010-02-05 Thread Stephen Powell
On Fri, 5 Feb 2010 18:27:49 -0500 (EST), Bob McGowan wrote: If someone wanted to, they could write a single program that would read input/write output from/to two or more descriptors, and use it to create a multi-path'ed I/O processing sequence, but writing it to prevent blocking on one

Bash question: get output as a variable?

2010-02-04 Thread Dotan Cohen
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 get that output

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 writes to

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 writes to

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 zlinux...@wowway.com 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

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

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 zlinux...@wowway.com 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

Re: bash question

2009-10-10 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 have both multiple

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 \ $RDSCHM \

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 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 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/ with sh -x i get this +

bash question

2009-10-09 Thread Alex Samad
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 rdiff-backup

Re: Probably very stupid script/bash question

2008-03-10 Thread Michelle Konzack
Am 2008-03-05 14:13:33, schrieb Brian: teststring=one two three four five six { read A B C D E F; } ( echo $teststring ) echo Data received = $E Bytes END OF REPLIED MESSAGE This look a little bit weird. Why not use:

Re: Probably very stupid script/bash question

2008-03-10 Thread Michelle Konzack
Am 2008-03-05 13:10:37, schrieb Bob McGowan: Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? man bash

Re: Probably very stupid script/bash question

2008-03-10 Thread Bob McGowan
Michelle Konzack wrote: Am 2008-03-05 14:13:33, schrieb Brian: teststring=one two three four five six { read A B C D E F; } ( echo $teststring ) echo Data received = $E Bytes END OF REPLIED MESSAGE This look a little bit weird. Why not use:

Re: Probably very stupid script/bash question

2008-03-10 Thread Bob McGowan
Michelle Konzack wrote: Am 2008-03-05 13:10:37, schrieb Bob McGowan: Mark Clarkson wrote: On Wed, 05 Mar 2008 12:16:02 -0800 Bob McGowan [EMAIL PROTECTED] wrote: Brian wrote: So can you explain exactly what the first ( echo $teststring ) does exactly please? man bash

  1   2   >