6 Answered Questions for the topic Scripting
How to count lines in a document?
I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.00 4.00 0.00 0.00 0.00 0.00 0.00 94.00 09:16:40 AM all 5.00 0.00 0.00 4.00 0.00 0.00 0.00... more
Why do you need to put #!/bin/bash at the beginning of a script file?
I have made [Bash] scripts before and they all ran fine without this at the beginning. What's the point of putting it in? Would things be any different? Also, how do you pronounce `#`? I know... more
How do I prompt for Yes/No/Cancel input in a Linux shell script?
I want to pause input in a shell script, and prompt the user for choices. The standard 'Yes, No, or Cancel' type question. How do I accomplish this in a typical bash prompt?
How do I know the script file name in a Bash script?
How can I determine the name of the Bash script file inside the script itself? Like if my script is in file `runme.sh`, then how would I make it to display "You are running runme.sh" message... more
How does "cat << EOF" work in bash?
I needed to write a script to enter multi-line input to a program (`psql`). After a bit of googling, I found the following syntax works: cat << EOF | psql ---params BEGIN; `pg_dump... more