Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Robert Moskowitz

Excellent!

On 05/05/2017 05:11 PM, Robbert Eggermont wrote:
It's certainly possible to include tabs in here documents, in shell 
scripts it works as expected.


However, when you input the here document on the command line in an 
interactive shell, the moment you enter the tab it immediately 
triggers Bash' programmable completion and the tab never reaches the 
here document.


To disable programmable completion (temporarily), run:
bind 'set disable-completion on'
To (re-)enable programmable completion, run:
bind 'set disable-completion off'


This works just fine.  Adds to all the sections where I have blocks with 
here documents with tabs, but better to turn it off and on each time, 
that assume it is in the right state.


Again, thanks.



Robbert

On 05-05-17 20:16, Robert Moskowitz wrote:
I thought this worked.  Many web pages tell you it works.  But bash 
is ignoring tabs in my here docs. Worst, where there are two tabs, it 
is functioning as a command expand in bash, where all files in the 
current directory are listed to complete the command.


The following is the here doc I am using.  Most likely the tabs will 
be converted to spaces in this email.  But the bottom line is, that 
while processing all the double tables, all the files in the current 
directory get listed, and the resultant file is all flush left, as if 
I had used the +EOF option:


Thing is, I thought I tested this previously, so it is possible that 
there is now something wrong in my environment causing the problem?


cat <00-init.conf || exit 1
ServerAdmin $admin_email
ServerName $your_host_tld

 
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all grantedve sh
 


 SSLEngine On
 SSLCertificateFile /etc/pki/tls/certs/$your_host_tld.crt
 SSLCertificateKeyFile /etc/pki/tls/private/$your_host_tld.key
 
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted
 

EOF

thanks

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos



___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Robbert Eggermont
It's certainly possible to include tabs in here documents, in shell 
scripts it works as expected.


However, when you input the here document on the command line in an 
interactive shell, the moment you enter the tab it immediately triggers 
Bash' programmable completion and the tab never reaches the here document.


To disable programmable completion (temporarily), run:
bind 'set disable-completion on'
To (re-)enable programmable completion, run:
bind 'set disable-completion off'

Robbert

On 05-05-17 20:16, Robert Moskowitz wrote:
I thought this worked.  Many web pages tell you it works.  But bash is 
ignoring tabs in my here docs.  Worst, where there are two tabs, it is 
functioning as a command expand in bash, where all files in the current 
directory are listed to complete the command.


The following is the here doc I am using.  Most likely the tabs will be 
converted to spaces in this email.  But the bottom line is, that while 
processing all the double tables, all the files in the current directory 
get listed, and the resultant file is all flush left, as if I had used 
the +EOF option:


Thing is, I thought I tested this previously, so it is possible that 
there is now something wrong in my environment causing the problem?


cat <00-init.conf || exit 1
ServerAdmin $admin_email
ServerName $your_host_tld

 
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all grantedve sh
 


 SSLEngine On
 SSLCertificateFile /etc/pki/tls/certs/$your_host_tld.crt
 SSLCertificateKeyFile /etc/pki/tls/private/$your_host_tld.key
 
 Options Indexes FollowSymLinks
 AllowOverride None
 Require all granted
 

EOF

thanks

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Jack Bailey



On 5/5/17 1:52 PM, Robert Moskowitz wrote:

On 05/05/2017 04:46 PM, John R Pierce wrote:

On 5/5/2017 1:41 PM, Robert Moskowitz wrote:


I just did a test where I created a file, xit, with the here document
in it and ran it with ./xit

This way, the tabs remained.  So the 'problem' is when I am pasting
the same lines (with tabs) into the terminal window. There bash is
interpreting the tabs and not feeding them into the here doc 
processing.



yes, bash interprets stdin differently than not stdin.



ARGH!!!

So can I control this?  I want the howto to be a cut-n-paste operation.
And I want to support real tabs not a bunch of spaces as I had 
previously...


Try  cat <<- EOF

Note the dash.  And yes, you must use tabs.  Spaces are suppressed 
whereas tabs are not.


Jack




___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Robert Moskowitz



On 05/05/2017 04:46 PM, John R Pierce wrote:

On 5/5/2017 1:41 PM, Robert Moskowitz wrote:


I just did a test where I created a file, xit, with the here document 
in it and ran it with ./xit


This way, the tabs remained.  So the 'problem' is when I am pasting 
the same lines (with tabs) into the terminal window. There bash is 
interpreting the tabs and not feeding them into the here doc processing.



yes, bash interprets stdin differently than not stdin.



ARGH!!!

So can I control this?  I want the howto to be a cut-n-paste operation.  
And I want to support real tabs not a bunch of spaces as I had previously...



___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread John R Pierce

On 5/5/2017 1:41 PM, Robert Moskowitz wrote:


I just did a test where I created a file, xit, with the here document 
in it and ran it with ./xit


This way, the tabs remained.  So the 'problem' is when I am pasting 
the same lines (with tabs) into the terminal window. There bash is 
interpreting the tabs and not feeding them into the here doc processing.



yes, bash interprets stdin differently than not stdin.


--
john r pierce, recycling bits in santa cruz

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Robert Moskowitz

More research...


On 05/05/2017 04:35 PM, Robert Moskowitz wrote:



On 05/05/2017 03:33 PM, Bill Campbell wrote:

On Fri, May 05, 2017, Robert Moskowitz wrote:

I thought this worked.  Many web pages tell you it works.  But bash is
ignoring tabs in my here docs.  Worst, where there are two tabs, it is
functioning as a command expand in bash, where all files in the current
directory are listed to complete the command.




I suspect that the shell is attempting to expand the '*'
character.  You need to escape the delimiter with a backslash
to keep the shell from expanding:


I tried that earlier, and \EOF did not help.  And I have env variables 
in the here doc I need replaced.  If I had to SED the file as a second 
step, I would have.  But like I said, \EOF did not make a difference.


I just did a test where I created a file, xit, with the here document in 
it and ran it with ./xit


This way, the tabs remained.  So the 'problem' is when I am pasting the 
same lines (with tabs) into the terminal window.  There bash is 
interpreting the tabs and not feeding them into the here doc processing.




I just tried this on a Fedora system, and got the same problem, yet:

http://stackoverflow.com/documentation/bash/655/here-documents-and-here-strings#t=201705051749422129426 



Gives examples with tabs in it.  As does:

http://tldp.org/LDP/abs/html/here-docs.html

Oh, this is done through cut-n-paste.  Cut from my web howto into a 
terminal window (screen usbtty into the Centos server).  Is Terminal 
suppressing the tabs from the clipboard?  I am using Xfce.





cat <<\EOF > 00-init.conf ...
...
EOF


cat <00-init.conf || exit 1
ServerAdmin $admin_email
ServerName $your_host_tld


Options Indexes FollowSymLinks
AllowOverride None
Require all granted



SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/$your_host_tld.crt
SSLCertificateKeyFile /etc/pki/tls/private/$your_host_tld.key

Options Indexes FollowSymLinks
AllowOverride None
Require all granted


EOF

thanks

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos



___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos



___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Robert Moskowitz



On 05/05/2017 03:33 PM, Bill Campbell wrote:

On Fri, May 05, 2017, Robert Moskowitz wrote:

I thought this worked.  Many web pages tell you it works.  But bash is
ignoring tabs in my here docs.  Worst, where there are two tabs, it is
functioning as a command expand in bash, where all files in the current
directory are listed to complete the command.




I suspect that the shell is attempting to expand the '*'
character.  You need to escape the delimiter with a backslash
to keep the shell from expanding:


I tried that earlier, and \EOF did not help.  And I have env variables 
in the here doc I need replaced.  If I had to SED the file as a second 
step, I would have.  But like I said, \EOF did not make a difference.


I just tried this on a Fedora system, and got the same problem, yet:

http://stackoverflow.com/documentation/bash/655/here-documents-and-here-strings#t=201705051749422129426

Gives examples with tabs in it.  As does:

http://tldp.org/LDP/abs/html/here-docs.html

Oh, this is done through cut-n-paste.  Cut from my web howto into a 
terminal window (screen usbtty into the Centos server).  Is Terminal 
suppressing the tabs from the clipboard?  I am using Xfce.





cat <<\EOF > 00-init.conf ...
...
EOF


cat <00-init.conf || exit 1
ServerAdmin $admin_email
ServerName $your_host_tld


Options Indexes FollowSymLinks
AllowOverride None
Require all granted



SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/$your_host_tld.crt
SSLCertificateKeyFile /etc/pki/tls/private/$your_host_tld.key

Options Indexes FollowSymLinks
AllowOverride None
Require all granted


EOF

thanks

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos



___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Bill Campbell
On Fri, May 05, 2017, Robert Moskowitz wrote:
>I thought this worked.  Many web pages tell you it works.  But bash is
>ignoring tabs in my here docs.  Worst, where there are two tabs, it is
>functioning as a command expand in bash, where all files in the current
>directory are listed to complete the command.
>


I suspect that the shell is attempting to expand the '*'
character.  You need to escape the delimiter with a backslash
to keep the shell from expanding:

cat <<\EOF > 00-init.conf ...
...
EOF

>cat <00-init.conf || exit 1
>ServerAdmin $admin_email
>ServerName $your_host_tld
>
>
>Options Indexes FollowSymLinks
>AllowOverride None
>Require all granted
>
>
>
>SSLEngine On
>SSLCertificateFile /etc/pki/tls/certs/$your_host_tld.crt
>SSLCertificateKeyFile /etc/pki/tls/private/$your_host_tld.key
>
>Options Indexes FollowSymLinks
>AllowOverride None
>Require all granted
>
>
>EOF
>
>thanks
>
>___
>CentOS mailing list
>CentOS@centos.org
>https://lists.centos.org/mailman/listinfo/centos
>

-- 
Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:  (206) 236-1676  Mercer Island, WA 98040-0820
Fax:(206) 232-9186  Skype: jwccsllc (206) 855-5792

The ultimate result of shielding men from the effects of folly is to fill
the world with fools. -- Herbert Spencer (1891)
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread Robert Moskowitz



On 05/05/2017 02:40 PM, John R Pierce wrote:

On 5/5/2017 11:16 AM, Robert Moskowitz wrote:

But bash is ignoring tabs in my here docs.


tab in bash is indeed filename expansion.   what are 'my here' docs ?  
not familiar with that phrase.






A *here document* is a special-purpose code block. It uses a form of I/O 
redirection to feed a command list to an interactive program or a 
command, such as ftp, cat, or the ex text editor.



 Here Documents - The Linux Documentation Project
 

tldp.org/LDP/abs/html/here-docs.html


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] tabs ignored in here document

2017-05-05 Thread John R Pierce

On 5/5/2017 11:16 AM, Robert Moskowitz wrote:

But bash is ignoring tabs in my here docs.


tab in bash is indeed filename expansion.   what are 'my here' docs ?  
not familiar with that phrase.




--
john r pierce, recycling bits in santa cruz

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] tabs ignored in here document

2017-05-05 Thread Robert Moskowitz
I thought this worked.  Many web pages tell you it works.  But bash is 
ignoring tabs in my here docs.  Worst, where there are two tabs, it is 
functioning as a command expand in bash, where all files in the current 
directory are listed to complete the command.


The following is the here doc I am using.  Most likely the tabs will be 
converted to spaces in this email.  But the bottom line is, that while 
processing all the double tables, all the files in the current directory 
get listed, and the resultant file is all flush left, as if I had used 
the +EOF option:


Thing is, I thought I tested this previously, so it is possible that 
there is now something wrong in my environment causing the problem?


cat <00-init.conf || exit 1
ServerAdmin $admin_email
ServerName $your_host_tld


Options Indexes FollowSymLinks
AllowOverride None
Require all granted



SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/$your_host_tld.crt
SSLCertificateKeyFile /etc/pki/tls/private/$your_host_tld.key

Options Indexes FollowSymLinks
AllowOverride None
Require all granted


EOF

thanks

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos