Re: Bash true/false builtings undocumented? "false" not working?

2018-08-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Aug 17, 2018 at 06:46:54PM +1000, Zenaan Harkness wrote: > 1) > Bash man page largely fails to document the true and false builtins > AFAICT, except for this sentence just under the heading > "^SHELL BUILTIN COMMANDS": &g

Re: Bash true/false builtings undocumented? "false" not working?

2018-08-17 Thread Zenaan Harkness
On Fri, Aug 17, 2018 at 10:51:03AM +0200, Nicolas George wrote: > Zenaan Harkness (2018-08-17): > > But whilst the subsequent list of Bash builtin commands DOES include > > entries for ":" (the very first entry) and "test", it appears to fail > > to

Re: Bash true/false builtings undocumented? "false" not working?

2018-08-17 Thread Nicolas George
Zenaan Harkness (2018-08-17): > But whilst the subsequent list of Bash builtin commands DOES include > entries for ":" (the very first entry) and "test", it appears to fail > to include entries for "true" and for "false". Maybe because it does th

Re: Bash true/false builtings undocumented? "false" not working?

2018-08-17 Thread Zenaan Harkness
On Fri, Aug 17, 2018 at 06:46:54PM +1000, Zenaan Harkness wrote: > 1) > Bash man page largely fails to document the true and false builtins > AFAICT, except for this sentence just under the heading > "^SHELL BUILTIN COMMANDS": > > The :, true, false, and test builti

Bash true/false builtings undocumented? "false" not working?

2018-08-17 Thread Zenaan Harkness
1) Bash man page largely fails to document the true and false builtins AFAICT, except for this sentence just under the heading "^SHELL BUILTIN COMMANDS": The :, true, false, and test builtins do not accept options and do not treat -- specially. But whilst the subsequent list of Ba

Re: non-blocking stdin from bash

2018-08-13 Thread Richard Hector
On 14/08/18 02:40, Greg Wooledge wrote: > So, yeah. It's warranted. Perhaps. > Idiot. That bit isn't, though. Richard signature.asc Description: OpenPGP digital signature

Re: non-blocking stdin from bash

2018-08-13 Thread Dan Purgert
Greg Wooledge wrote: > On Mon, Aug 13, 2018 at 02:58:54PM -, Dan Purgert wrote: >> Greg Wooledge wrote: >> > [...] >> > It's absolutely warranted. You changed the question, and then you >> > changed the question AGAIN.. >> >> This reminds me of bashphorisms 1 through 3. Although, I guess the

Re: non-blocking stdin from bash

2018-08-13 Thread Greg Wooledge
On Mon, Aug 13, 2018 at 02:58:54PM -, Dan Purgert wrote: > Greg Wooledge wrote: > > [...] > > It's absolutely warranted. You changed the question, and then you changed > > the question AGAIN. > > This reminds me of bashphorisms 1 through 3. Although, I guess they're > more related to the IRC

Re: non-blocking stdin from bash

2018-08-13 Thread Dan Purgert
Greg Wooledge wrote: > [...] > It's absolutely warranted. You changed the question, and then you changed > the question AGAIN. This reminds me of bashphorisms 1 through 3. Although, I guess they're more related to the IRC channel. -- |_|O|_| Registered Linux user #585947 |_|_|O| Github: https

Re: non-blocking stdin from bash

2018-08-13 Thread Jim Popovitch
x27;s the best way to grab anything that's in stdin into a > > > > variable inside a bash script, but won't block if stdin is > > > > null? > > > > > > On Sun, Aug 12, 2018 at 01:57:09PM -0400, Jim Popovitch wrote: > > > > Interesting.  I&

Re: non-blocking stdin from bash

2018-08-13 Thread Greg Wooledge
On Mon, Aug 13, 2018 at 10:34:40AM -0400, Jim Popovitch wrote: > On Mon, 2018-08-13 at 08:59 -0400, Greg Wooledge wrote: > > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > > > What's the best way to grab anything that's in stdin into a > > &g

Re: non-blocking stdin from bash

2018-08-13 Thread Jim Popovitch
On Mon, 2018-08-13 at 08:59 -0400, Greg Wooledge wrote: > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > > What's the best way to grab anything that's in stdin into a > > variable inside a bash script, but won't block if stdin is null? > >

Re: non-blocking stdin from bash

2018-08-13 Thread Greg Wooledge
On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > What's the best way to grab anything that's in stdin into a variable > inside a bash script, but won't block if stdin is null? On Sun, Aug 12, 2018 at 01:57:09PM -0400, Jim Popovitch wrote: > Interesting.

Re: non-blocking stdin from bash

2018-08-12 Thread Jim Popovitch
On Mon, 2018-08-13 at 10:13 +1200, Richard Hector wrote: > On 13/08/18 05:57, Jim Popovitch wrote: > > Interesting.  I'm using it via a cron script like so: > > > > * * * * *  grep "unusual" /opt/logs/* | /opt/notify.sh `hostname`; > > I don't know what's in notify.sh, but it looks to me like you

Re: non-blocking stdin from bash

2018-08-12 Thread Richard Hector
On 13/08/18 05:57, Jim Popovitch wrote: > Interesting. I'm using it via a cron script like so: > > * * * * * grep "unusual" /opt/logs/* | /opt/notify.sh `hostname`; I don't know what's in notify.sh, but it looks to me like you're going to get notified every minute for all the unusual log entrie

Re: non-blocking stdin from bash

2018-08-12 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 12, 2018 at 01:57:09PM -0400, Jim Popovitch wrote: > On Sun, 2018-08-12 at 19:47 +0200, to...@tuxteam.de wrote: [...] > > This will block in the read as long as the line isn't yet terminated. > > But of course fine, if it rocks your boat

Re: non-blocking stdin from bash

2018-08-12 Thread Jim Popovitch
On Sun, 2018-08-12 at 19:47 +0200, to...@tuxteam.de wrote: > On Sun, Aug 12, 2018 at 12:34:08PM -0400, Jim Popovitch wrote: > > [...] > > > Turns out I had mis-read your first reply as "-t 1", chiefly > > because > > Ah, I see. > > > that was all that I had found before posting here.  What now

Re: non-blocking stdin from bash

2018-08-12 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Aug 12, 2018 at 12:34:08PM -0400, Jim Popovitch wrote: [...] > Turns out I had mis-read your first reply as "-t 1", chiefly because Ah, I see. > that was all that I had found before posting here. What now works for > me avoids the -t param

Re: non-blocking stdin from bash

2018-08-12 Thread Jim Popovitch
o! > > > > > > > > What's the best way to grab anything that's in stdin into a > > > > variable > > > > inside a bash script, but won't block if stdin is null? > > > > > > I think read is your friend (at least in ba

Re: non-blocking stdin from bash

2018-08-12 Thread tomas
gt; > What's the best way to grab anything that's in stdin into a > > > variable > > > inside a bash script, but won't block if stdin is null? > > > > I think read is your friend (at least in bash). It has an option > > -t , which you can set to zero

Re: non-blocking stdin from bash

2018-08-11 Thread Jim Popovitch
On Sun, 2018-08-12 at 00:48 +0200, to...@tuxteam.de wrote: > On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > > Hello! > > > > What's the best way to grab anything that's in stdin into a > > variable > > inside a bash script, but won

Re: non-blocking stdin from bash

2018-08-11 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, Aug 11, 2018 at 06:08:34PM -0400, Jim Popovitch wrote: > Hello! > > What's the best way to grab anything that's in stdin into a variable > inside a bash script, but won't block if stdin is null? I think read is yo

non-blocking stdin from bash

2018-08-11 Thread Jim Popovitch
Hello! What's the best way to grab anything that's in stdin into a variable inside a bash script, but won't block if stdin is null? -Jim P.

Re: ssh config "Include" and bash completion

2018-05-14 Thread Javier Barroso
Hello Greg, On Mon, May 14, 2018 at 3:35 PM, Greg Wooledge wrote: > On Mon, May 14, 2018 at 03:29:22PM +0200, Javier Barroso wrote: >> Maybe you can improve the script talking / sendind pull request? with >> żupstream? żhttps://github.com/scop/bash-completion? >> >> Th

Re: ssh config "Include" and bash completion

2018-05-14 Thread Greg Wooledge
On Mon, May 14, 2018 at 03:29:22PM +0200, Javier Barroso wrote: > Maybe you can improve the script talking / sendind pull request? with > ¿upstream? ¿https://github.com/scop/bash-completion? > > Thank you ! Not likely to happen. > == OFF TOPIC == > An annoying bug on debia

Re: ssh config "Include" and bash completion

2018-05-14 Thread Javier Barroso
erate over the "array" using an unquoted expansion. > > Code like this is one reason why I do not use bash-completion. Any time > it doesn't fail is just a lucky coincidence. > > In this particular instance, it "works" so long as each pathname in > sed

Re: ssh config "Include" and bash completion

2018-05-14 Thread Greg Wooledge
correctly, there'll be one pathname per line. > for i in ${included[@]}; do But then the function attempts to treat the string variable as an array, and then attempts to iterate over the "array" using an unquoted expansion. Code like this is one reason why I do not use bash-com

Re: ssh config "Include" and bash completion

2018-05-14 Thread Richard Hector
On 14/05/18 21:51, Javier Barroso wrote: > Hello Hector, > > It work for me: > > $ grep "Include\|testing" /etc/ssh/ssh_config ; cat /etc/ssh/ssh.d/test > Include /etc/ssh/ssh.d/test > Host testing > Hostname 1.1.1.1 > > $ ssh test => testing > $ d

Re: ssh config "Include" and bash completion

2018-05-14 Thread Richard Hector
On 14/05/18 18:09, Richard Hector wrote: > Hi all, > > I recently started using the Include directive in my .ssh/config file - > so all the definitions are now in .ssh/config.d/. > > Now bash completion of hostnames no longer works. Is this expected > behaviour? Anyo

Re: ssh config "Include" and bash completion

2018-05-14 Thread Javier Barroso
On Mon, May 14, 2018 at 11:51 AM, Javier Barroso wrote: > Hello Hector, > > It work for me: > > $ grep "Include\|testing" /etc/ssh/ssh_config ; cat /etc/ssh/ssh.d/test > Include /etc/ssh/ssh.d/test > Host testing > Hostname 1.1.1.1 > > $ ssh test => te

Re: ssh config "Include" and bash completion

2018-05-14 Thread Javier Barroso
Hello Hector, It work for me: $ grep "Include\|testing" /etc/ssh/ssh_config ; cat /etc/ssh/ssh.d/test Include /etc/ssh/ssh.d/test Host testing Hostname 1.1.1.1 $ ssh test => testing $ dpkg -l bash-completion Deseado=desconocido(U)/Instalar/eliminaR/Purgar/retener(H) | Estado=No/

Re: ssh config "Include" and bash completion

2018-05-14 Thread Richard Hector
On 14/05/18 20:49, john doe wrote: > On 5/14/2018 8:09 AM, Richard Hector wrote: >> Hi all, >> >> I recently started using the Include directive in my .ssh/config file - >> so all the definitions are now in .ssh/config.d/. >> >> Now bash completion of host

Re: ssh config "Include" and bash completion

2018-05-14 Thread john doe
On 5/14/2018 8:09 AM, Richard Hector wrote: Hi all, I recently started using the Include directive in my .ssh/config file - so all the definitions are now in .ssh/config.d/. Now bash completion of hostnames no longer works. Is this expected behaviour? Anyone know how to fix it, without

ssh config "Include" and bash completion

2018-05-13 Thread Richard Hector
Hi all, I recently started using the Include directive in my .ssh/config file - so all the definitions are now in .ssh/config.d/. Now bash completion of hostnames no longer works. Is this expected behaviour? Anyone know how to fix it, without reverting to a single file? I couldn't work ou

Re: A recomended guide to vim - was {Re: Does bash have a tool ?}

2018-03-09 Thread Cousin Stanley
Richard Owlett wrote: > > For example, GVIM launches with an unreadably small font. > > I have found the instructions to do ":set guifont=*". > > However I wish to set things appropriately in ~/.vimrc . > > I ended up in a sample script to insert. > > However I c

Re: A recomended guide to vim - was {Re: Does bash have a tool ?}

2018-03-09 Thread Richard Owlett
end of each body. Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which describes tools to do word frequency tasks, primarily with bash builtins. First I need to eliminate the irrelevant text between "KEY2" of the previous message and "KEY1" of the message of

Re: A recomended guide to vim - was {Re: Does bash have a tool ?}

2018-03-07 Thread Curt
eginning of the body of each message. Similarly, I've placed "KEY2" at >>>> the end of each body. >>>> >>>> Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which >>>> describes tools to do word frequency tasks, primarily wit

A recomended guide to vim - was {Re: Does bash have a tool ?}

2018-03-07 Thread Richard Owlett
16.html> which describes tools to do word frequency tasks, primarily with bash builtins. First I need to eliminate the irrelevant text between "KEY2" of the previous message and "KEY1" of the message of interest. It should be straight forard to do in BASIC. vim (hit escap

Re: Does bash have a tool ?

2018-03-05 Thread Gregory Seidman
; Using a text editor's search&replace function I've placed "KEY1" at the > beginning of the body of each message. Similarly, I've placed "KEY2" at the > end of each body. > > Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which &

Re: Does bash have a tool ?

2018-03-05 Thread John Hasler
That looks like a real Model 19 ASR. -- John Hasler jhas...@newsguy.com Elmwood, WI USA

Re: Does bash have a tool ?

2018-03-05 Thread Curt
On 2018-03-05, John Hasler wrote: > I wrote: >> The Model 19 was more fun. > > Richard Owlett writes: >> Don't recognize the model. > > And here I thought you went way back. The Model 19 did 5-level baudot. > We used them for amateur radio teletype in the 60s. The machine had > some real heft to

Re: Does bash have a tool ?

2018-03-05 Thread John Hasler
I wrote: > The Model 19 was more fun. Richard Owlett writes: > Don't recognize the model. And here I thought you went way back. The Model 19 did 5-level baudot. We used them for amateur radio teletype in the 60s. The machine had some real heft to it. It was driven by a 1/4 hp motor. Lots of r

Re: Does bash have a tool ?

2018-03-05 Thread Richard Owlett
editor's search&replace function I've placed "KEY1" at the beginning of the body of each message. Similarly, I've placed "KEY2" at the end of each body. Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which describes tools to do word fre

Re: Does bash have a tool ?

2018-03-05 Thread Erik Christiansen
On 05.03.18 03:06, Richard Owlett wrote: > > As to "manpages not a tutorial" *ROFL* > I'll admit content is there, but ... > I've been referred to vim. Although awk and cousins are probably under the > surface, vim.org is fascinating and accessible to end users such as myself. A good text

Re: Does bash have a tool ?

2018-03-05 Thread Richard Owlett
On 03/04/2018 09:28 PM, John Hasler wrote: Richard Owlett writes: Do youngsters here recognize they are being teased? a KSR-35 wrote/read paper tape a 026 punched Hollerith(sp?) cards We'll leave to their anemic imagination what "high speed paper tape" might be! *ROFL* You're describing an ASR

Re: Does bash have a tool ?

2018-03-05 Thread Richard Owlett
On 03/04/2018 11:40 PM, Erik Christiansen wrote: On 04.03.18 10:28, Richard Owlett wrote: I don't have any background in Perl and the last formal course in programming was in the 60's. However awk and/or sed may be what I'm looking for and are well documented. Your description of nedit is inte

Re: Does bash have a tool ?

2018-03-04 Thread Erik Christiansen
On 04.03.18 10:28, Richard Owlett wrote: > > I don't have any background in Perl and the last formal course in > programming was in the 60's. > > However awk and/or sed may be what I'm looking for and are well documented. > Your description of nedit is interesting. I'll investigate. I'm on my way

Re: Does bash have a tool ?

2018-03-04 Thread rhkramer
On Sunday, March 04, 2018 09:18:56 PM Richard Hector wrote: > A KSR-35 seems to be a sniper rifle ... Ah, but an IBM 026 might be a > key punch? So I guess the KSR-35 is for punching paper tape at a > distance. Communication was primitive in those days, wasn't it :-) LOL!!

Re: Does bash have a tool ?

2018-03-04 Thread John Hasler
Richard Owlett writes: > Do youngsters here recognize they are being teased? > a KSR-35 wrote/read paper tape > a 026 punched Hollerith(sp?) cards > We'll leave to their anemic imagination what "high speed paper tape" might > be! *ROFL* You're describing an ASR (Automatic Send Receive) teleprinter

Re: Does bash have a tool ?

2018-03-04 Thread Richard Owlett
On 03/04/2018 06:51 PM, David Wright wrote: On Sun 04 Mar 2018 at 12:14:36 (-0600), John Hasler wrote: Richard Owlett writes: I don't have any background in Perl and the last formal course in programming was in the 60's. Perl is just bash, ed, sed, awk, grep, etc all smushed tog

Re: Does bash have a tool ?

2018-03-04 Thread Richard Owlett
On 03/04/2018 08:18 PM, Richard Hector wrote: [snip ;] You youngsters. KSR-35 and 026 are my speed ;} A KSR-35 seems to be a sniper rifle ... Ah, but an IBM 026 might be a key punch? So I guess the KSR-35 is for punching paper tape at a distance. Communication was primitive in those days, wasn

Re: Does bash have a tool ?

2018-03-04 Thread Richard Hector
On 05/03/18 07:59, Richard Owlett wrote: > On 03/04/2018 11:02 AM, rhkra...@gmail.com wrote: >> On Sunday, March 04, 2018 11:28:55 AM Richard Owlett wrote: >>> I don't have any background in Perl and the last formal course in >>> programming was in the 60's. >> >> Mine was very early 70's ('71) >>

Re: Does bash have a tool ?

2018-03-04 Thread David Wright
On Sun 04 Mar 2018 at 12:14:36 (-0600), John Hasler wrote: > Richard Owlett writes: > > I don't have any background in Perl and the last formal course in > > programming was in the 60's. > > Perl is just bash, ed, sed, awk, grep, etc all smushed together into >

Re: An answer - was [Re: Does bash have a tool ?]

2018-03-04 Thread Forest Dean Feighner
;> beginning of the body of each message. Similarly, I've placed "KEY2" at the >> end of each body. >> >> Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which >> describes tools to do word frequency tasks, primarily with bash builtins. >&

An answer - was [Re: Does bash have a tool ?]

2018-03-04 Thread Richard Owlett
mp;replace function I've placed "KEY1" at the beginning of the body of each message. Similarly, I've placed "KEY2" at the end of each body. Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which describes tools to do word frequency tasks, primarily wi

Re: Does bash have a tool ?

2018-03-04 Thread Richard Owlett
On 03/04/2018 11:02 AM, rhkra...@gmail.com wrote: On Sunday, March 04, 2018 11:28:55 AM Richard Owlett wrote: I don't have any background in Perl and the last formal course in programming was in the 60's. Mine was very early 70's ('71) However awk and/or sed may be what I'm looking for and a

Re: Does bash have a tool ?

2018-03-04 Thread John Hasler
Richard Owlett writes: > I don't have any background in Perl and the last formal course in > programming was in the 60's. Perl is just bash, ed, sed, awk, grep, etc all smushed together into one. > However awk and/or sed may be what I'm looking for and are well > doc

Re: Does bash have a tool ?

2018-03-04 Thread Curt
search&replace function I've placed "KEY1" at the > beginning of the body of each message. Similarly, I've placed "KEY2" at > the end of each body. > > Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which > describes tools t

Re: Does bash have a tool ?

2018-03-04 Thread rhkramer
On Sunday, March 04, 2018 11:28:55 AM Richard Owlett wrote: > I don't have any background in Perl and the last formal course in > programming was in the 60's. Mine was very early 70's ('71) > However awk and/or sed may be what I'm looking for and are well > documented. Your description of nedit i

Re: Does bash have a tool ?

2018-03-04 Thread Richard Owlett
On 03/04/2018 10:02 AM, rhkra...@gmail.com wrote: On Sunday, March 04, 2018 10:26:51 AM Richard Owlett wrote: First I need to eliminate the irrelevant text between "KEY2" of the previous message and "KEY1" of the message of interest. It should be straight forard to do in BASIC. But is there an

Re: Does bash have a tool ?

2018-03-04 Thread rhkramer
On Sunday, March 04, 2018 10:26:51 AM Richard Owlett wrote: > First I need to eliminate the irrelevant text between "KEY2" of the > previous message and "KEY1" of the message of interest. It should be > straight forard to do in BASIC. > > But is there an already tested function for that? Well, I

Does bash have a tool ?

2018-03-04 Thread Richard Owlett
; at the beginning of the body of each message. Similarly, I've placed "KEY2" at the end of each body. Searches led to <http://www.dsl.org/cookbook/cookbook_16.html> which describes tools to do word frequency tasks, primarily with bash builtins. First I need to eliminate

bash date behavior (buggy) (was: Re: policy around 'wontfix' bug tag)

2018-02-06 Thread rhkramer
y > > silently break in a future version (e.g. possibly as a consequence > > of a bug fix). So this is a good example of what you should *not* > > do. > > If I have the luxury of writing in a real language, then I prefer > to use that language's date/time libraries,

Re: Stretch - bash crash when reach ulimit file size

2018-01-26 Thread Felipe Salvador
On Fri, Jan 26, 2018 at 11:05:09AM -0500, Greg Wooledge wrote: > Yes, it's a bug in his script. Not in bash. > > Resource limits are quite low-level; they are implemented as kernel > system calls (see setrlimit(2)). Processes which violate a resource > limit are signalled by

Re: Stretch - bash crash when reach ulimit file size

2018-01-26 Thread Peter Hillier-Brook
On 26/01/18 16:05, Greg Wooledge wrote: > On Fri, Jan 26, 2018 at 03:45:22PM +, Peter Hillier-Brook wrote: >> On 26/01/18 10:47, Felipe Salvador wrote: >>> $ while true; do echo a>>a; done >>> >>> makes bash crash when file size is reached > &

Re: Stretch - bash crash when reach ulimit file size

2018-01-26 Thread Greg Wooledge
On Fri, Jan 26, 2018 at 03:45:22PM +, Peter Hillier-Brook wrote: > On 26/01/18 10:47, Felipe Salvador wrote: > > $ while true; do echo a>>a; done > > > > makes bash crash when file size is reached > A crash is always a bug. I suggest that you report it as su

Re: Stretch - bash crash when reach ulimit file size

2018-01-26 Thread Peter Hillier-Brook
On 26/01/18 10:47, Felipe Salvador wrote: > Hi list, > setting > > ulimit -f 1024 > > and running (for example) > > $ while true; do echo a>>a; done > > makes bash crash when file size is reached > > Warning: Program '/bin/bash&

Stretch - bash crash when reach ulimit file size

2018-01-26 Thread Felipe Salvador
Hi list, setting ulimit -f 1024 and running (for example) $ while true; do echo a>>a; done makes bash crash when file size is reached Warning: Program '/bin/bash' crashed. $ du a 1024/home/felipe/a I would expect an error or something else

Re: bash array

2018-01-25 Thread Gokan Atmaca
"cat" and the > expansion of "$pass" with the string .list appended to it, which is what > your previous line created. > >> example-script: >>-- user.list >> a >> b >> c >> >> -- pass.list >>

Re: bash array

2018-01-25 Thread Greg Wooledge
yyy > zzz With all that whitespace? Or should I just assume that the "xxx" is NOT indented as shown, but is instead an entire line? What do you want to DO with these files? > script: > > #!/bin/bash > > > pass=$(cat pass.list) Now, you see, this is ENTI

Re: bash array

2018-01-25 Thread Gokan Atmaca
>> I have the user list and the password list. I shot them with BASH. I >> want to give passwords to the usernames in these separate files in >> order. >> >> File names: >> Users.list >> Passwords.list Hello I'm sorry for the late reply. The problem

Re: bash array

2018-01-15 Thread Greg Wooledge
On Sun, Jan 14, 2018 at 03:46:06PM +0300, Gokan Atmaca wrote: > I have the user list and the password list. I shot them with BASH. I > want to give passwords to the usernames in these separate files in > order. > > File names: > Users.list > Passwords.list > > In a loo

Re: bash array

2018-01-14 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, Jan 14, 2018 at 03:46:06PM +0300, Gokan Atmaca wrote: > Hello > > I have the user list and the password list. I shot them with BASH. I > want to give passwords to the usernames in these separate files in > order. > > Fil

bash array

2018-01-14 Thread Gokan Atmaca
Hello I have the user list and the password list. I shot them with BASH. I want to give passwords to the usernames in these separate files in order. File names: Users.list Passwords.list In a loop, I have to not throw them into users of these passwords. I did this for it, but it did not work

Re: inotifywait in bash script: space

2017-12-05 Thread davidson
On Sat, 2 Dec 2017, B.M. wrote: Dear all, not a Debian specific question, but I hope to get an answer here... I try to use inotifywait in a bash script to block until a file in a directory gets changed. Then the script should continue. That's working well unless the path I hand ov

Re: inotifywait in bash script: space

2017-12-03 Thread B.M.
Dear all, thank you for your inputs - indeed, I had to add "eval" to my script to get it working. Best, Bernd On Samstag, 2. Dezember 2017 17:10:10 CET you wrote: > Dear all, > > not a Debian specific question, but I hope to get an answer here... > > I try to

Re: inotifywait in bash script: space

2017-12-02 Thread Thomas Schmitt
"a b c" $ X="echo \"$Y\"" $ $X "a b c" Obviously "echo" sees three arguments here: "a b c" I get the expected result by $ eval "$X" a b c Still being riddled, my theory is that bash variable substitution ha

inotifywait in bash script: space

2017-12-02 Thread B.M.
Dear all, not a Debian specific question, but I hope to get an answer here... I try to use inotifywait in a bash script to block until a file in a directory gets changed. Then the script should continue. That's working well unless the path I hand over to inotifywait contains spaces. I al

Re: Editing Problem with bash script and sed

2017-11-18 Thread Rusi Mody
On Tuesday, November 14, 2017 at 9:50:06 PM UTC+5:30, Thomas George wrote: > The problem is editing long file names to shorten them. An example group > of file names is attached. > > The bash script copied from BashScripting is attached. This script works > perfectly with simple

Re: Editing Problem with bash script and sed RESOLVED

2017-11-14 Thread Thomas George
cript were an education explaining why it did not work as expected. On 11/14/2017 11:07 AM, Thomas George wrote: The problem is editing long file names to shorten them. An example group of file names is attached. The bash script copied from BashScripting is attached. This script works perfectly

Re: Editing Problem with bash script and sed

2017-11-14 Thread David Wright
On Tue 14 Nov 2017 at 11:07:47 (-0500), Thomas George wrote: > The problem is editing long file names to shorten them. > An example group of file names is attached. I thought someone might mention MC for doing this. The sequence of operations I would use here is: Select the files you want to ch

Re: Editing Problem with bash script and sed

2017-11-14 Thread Greg Wooledge
l unfixed. If the user input ("$1") is to be treated as an ERE, then you could do something like this: for filename in *; do [[ $filename =~ $1 ]] || continue ... done But your grep is treating "$1" as a BRE, not an ERE, and bash doesn't have any implementatio

Re: Editing Problem with bash script and sed

2017-11-14 Thread Greg Wooledge
On Tue, Nov 14, 2017 at 07:21:55PM +0100, Thomas Schmitt wrote: > ls -d * | grep "$1" | while read filename Eww. No. That code is broken in multiple ways. > n=$(echo "$fname" | sed -e s/"$1"//) > > Regrettably i found no way to make this safe against newlines in filenames.

Re: Editing Problem with bash script and sed

2017-11-14 Thread Thomas Schmitt
Hi, after reading man 1 "read", i have to add option "-r" to my proposal: ls -d * | grep "$1" | while read -r filename Have a nice day :) Thomas

Re: Editing Problem with bash script and sed

2017-11-14 Thread Thomas Schmitt
Hi, i see at least one problem in Trim_Line.sh : It uses "$1" as shell parser input and as sed regular expression. With "S.*-" as "$1", the meaning differs in both contexts. The shell parser input of for filename in *$1* will look for files with a text snippet "S.". The expression in s/$1

Re: Editing Problem with bash script and sed

2017-11-14 Thread Roberto C . Sánchez
On Tue, Nov 14, 2017 at 11:07:47AM -0500, Thomas George wrote: > > After experimenting with regular expressions with sed I found ls | sed -e > s/S.*-// reduced the file names in File.txt to just the names of the Carols > as shown in sed.txt. Used like this sed leaves the original file unchanged. >

Editing Problem with bash script and sed

2017-11-14 Thread Thomas George
The problem is editing long file names to shorten them. An example group of file names is attached. The bash script copied from BashScripting is attached. This script works perfectly with simple deletions, for example TrimLine.sh "College" "" will remove College from e

Re: bash usage.

2017-11-05 Thread David Margerison
On 5 November 2017 at 19:17, wrote: > > Note that the mount(8) man page recommends findmnt(8) for script > usage. Findmnt is util-linux, so whether you want to use it or > not will depend a bit on your portability needs. > > Parsing mount output robustly is, of course, always a good exercise. Ah

Re: bash usage.

2017-11-05 Thread tomas
checked easily? > > It can be done by inspecting the output of the 'mount' command. > But keep in mind that the detail of this output may not be stable > between versions of mount, or other factors that might change > its content, such as releases of operating systems. &

Re: bash usage.

2017-11-04 Thread David Margerison
On 5 November 2017 at 08:31, David Margerison wrote: > > Demo example from an interactive bash command line on this PC: > > $ devname=/dev/sda6 ; dirname=/mnt/p/A ; if mount | grep -q -- > "$devname on $dirname" ; then echo "$devname is mounted on $dirname" ;

Re: bash usage.

2017-11-04 Thread David Margerison
t may not be stable between versions of mount, or other factors that might change its content, such as releases of operating systems. Demo example from an interactive bash command line on this PC: $ devname=/dev/sda6 ; dirname=/mnt/p/A ; if mount | grep -q -- "$devname on $dirname" ; t

Re: bash usage.

2017-11-04 Thread peter
* From: Roberto C. Sánchez * Date: Wed, 25 Oct 2017 21:23:14 -0400 > The return status is seen by the shell as a numeric. ... * From: Kushal Kumaran * Date: Thu, 26 Oct 2017 07:01:30 +0530 > write it like this: ... See man test(1) for details. * From: David Margeri

Re: bash usage.

2017-10-26 Thread Jude DaShiell
bash has a comments syntax to document what may not necessarily be clear with scripts. If I write a script at minimum just below the #!/usr/bin/env bash line I have a # file: line giving the file name followed by a dash and a little bit of a description what the script is supposed to do

Re: bash usage.

2017-10-26 Thread Roberto C . Sánchez
On Thu, Oct 26, 2017 at 11:12:16PM +1100, David Margerison wrote: > > That's a fair point, but the documentation of the 'if' statement in 'man bash' > will make that immediately clear to anyone who cares to read it. > You must regularly deal with different

Re: bash usage.

2017-10-26 Thread David Margerison
the exit status, not the output. I know that the if > evaluates the exit status, but that may not be immediately evident to > someone who is not particularly familiar with shell programming. That's a fair point, but the documentation of the 'if' statement in 'man bash'

Re: bash usage.

2017-10-26 Thread Roberto C . Sánchez
On Thu, Oct 26, 2017 at 04:19:42PM +1100, David Margerison wrote: > On 26 October 2017 at 11:39, wrote: > > > > According to 'man mountpoint', it returns 0 if something is mounted. > > So why the complaint from > > if [ mountpoint $WorkingDirectory ] ? > > Answered here: > > http://mywiki.woo

Re: bash usage.

2017-10-25 Thread David Margerison
On 26 October 2017 at 11:39, wrote: > > According to 'man mountpoint', it returns 0 if something is mounted. > So why the complaint from > if [ mountpoint $WorkingDirectory ] ? Answered here: http://mywiki.wooledge.org/BashPitfalls#if_.5Bgrep_foo_myfile.5D http://mywiki.wooledge.org/BashGuid

Re: bash usage.

2017-10-25 Thread Kushal Kumaran
is script. > > #!/bin/bash > # Demonstrate use of "mountpoint" in a script to determine > # whether a directory has a device mounted on it. > # > WorkingDirectory=/home/peter/testdir > if [ mountpoint $WorkingDirectory ] > then > echo A volume is mounted

Re: bash usage.

2017-10-25 Thread Roberto C . Sánchez
. It is not coerced to a boolean (like Perl or Python would do). Try this instead: #!/bin/bash # Demonstrate use of "mountpoint" in a script to determine # whether a directory has a device mounted on it. # WorkingDirectory=/home/peter/testdir mountpoint -q $WorkingDirectory if [[ $?

bash usage.

2017-10-25 Thread peter
PROBLEM Given a storage device, /dev/GRN, and mount point, /home/peter/testdir/, determine in a shell script whether /dev/GRN is mounted or something is mounted on /home/peter/testdir/. ATTEMPTED SOLUTION Create testdir and execute this script. #!/bin/bash # Demonstrate use of "mountpoin

<    2   3   4   5   6   7   8   9   10   11   >