Thread: bash scripting?

  1. #1
    Registered User Draco's Avatar
    Join Date
    Apr 2002
    Posts
    463

    bash scripting?

    I am writing a bash script to do some basic database operations. I am not familiar with all of bash scripting's abilities yet. Can I edit specific lines and portions of lines in a file with bash scripting or do I need to use something else? I would do the whole thing in C but I want to use cron to autoupdate the database

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > I would do the whole thing in C but I want to use cron to autoupdate the database
    cron is not limited to only running bash scripts you know...

    > Can I edit specific lines and portions of lines in a file with bash scripting
    It's pretty much the same problem as in C. If you want to change a text file, you read it in, make some changes, and write it out.

    Simple edits can usually be achieved with 'sed'.
    For more complicated text manipulations, I usually use Perl.

    > or do I need to use something else?
    Like I said, it doesn't "need" to be something else just to make it runnable from cron.

    As with many tools, there is considerable overlap in the capabilities, so I guess you should start with the ones you feel comfortable using.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-10-2009, 12:57 AM
  2. BASH scripting.
    By Kennedy in forum Tech Board
    Replies: 6
    Last Post: 05-06-2007, 06:13 PM
  3. Reviving my old scripting language.
    By suzakugaiden in forum Game Programming
    Replies: 4
    Last Post: 06-15-2006, 03:02 PM
  4. Replies: 6
    Last Post: 06-08-2006, 04:11 PM
  5. redirecting standard error in Bash
    By wozza in forum Linux Programming
    Replies: 3
    Last Post: 07-16-2002, 04:55 AM