What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 128 Stack Exchange communities.

Why can't I just enclose code in code /code tags?

There must be something simpler than spacebar x4 in front of each line, no?

#!/bin/bash

echo ************************BEGIN LOG******************************
date +"%m/%d/%Y %H:%M:%S $HOSTNAME"
cp -f /scripts/original/clamscans.log /scripts
find /public/public/clamscans/. -exec grep -n FOUND /dev/null {} \;>>clamscans.log
mail somedude@someplace.com < clamscans.log
tar cvf dailyresults.tar /public/public/clamscans/*.txt
gzip -f dailyresults.tar
mv -f /public/public/clamscans/*.txt /scripts/lastnite
echo end log entry
share|improve this question

migrated from stackoverflow.com Sep 24 '10 at 16:35

This question came from our site for professional and enthusiast programmers.

    
I wonder if whoever's giving the minus points might explain what's wrong with my question? –  micah Sep 24 '10 at 16:32
    
@micah, it's probably because this question is about StackOverflow itself, so it belongs on the meta site. –  Brandon Sep 24 '10 at 16:33
    
ok, that makes sense. Sorry. –  micah Sep 24 '10 at 16:34
add comment

3 Answers 3

up vote 5 down vote accepted

There is a button above this code edit window that looks like 1's and 0's. Highlight all your code and click that button and it will indent it for you.

This probably should be on meta.

share|improve this answer
    
Cool! I didn't even notice it was right in front of my face like that. I was distracted by the big "How to Format" widget on the right that led me to several sub places going into copious detail yet never showing me how to do this simple task. –  micah Sep 24 '10 at 16:30
    
Learn something new every day. Not the button, the fact you could just space 4x for code :P –  Ryan Ternier Sep 24 '10 at 16:30
add comment

You can use html tag pre and code or select your text and hit the button with 0s and 1s over the text field.

share|improve this answer
    
code tags don't properly handle the #!/bin/bash line. Treats it like a H1 tag er something. However, the pre /pre solution does seem to work. Thank you. –  Flotsam E. Jetsam Sep 24 '10 at 16:45
    
Do not use <pre><code> for this. –  Gnome Sep 24 '10 at 16:51
add comment

Select the code and hit ctrl-k.

share|improve this answer
    
That works too. Thanks. –  Flotsam E. Jetsam Sep 24 '10 at 16:57
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .