Results 1 to 3 of 3
  1. #1

    Member Since
    Oct 26, 2010
    help using terminal
    I'm taking a survey course of languages and we are covering perl this week. I have never used terminal before. I need to write perl script that will parse xml data, but I can't even figure out how to use the terminal.
    when I open the terminal I get this line(I subed out my name and username):

    firstName-LastName-MacBook-Pro:~ username$

    i have tried the commands ls and that works, but I can't figure out how to run scripts from a file. I have tried a simple hello world app by typing:

    print "Hello World!\n";

    in text edit saving it as then I tried to type in the terminal and it says
    -bash: command not found

    can someone explain in simple terms how to run simple programs like this?

    thanks, aaron

  2. #2

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Groves, Texas
    21in. iMac 10.11 --- HP Linux Mint 18
    Find yourself a website on using the Bash shell and shell scripting. Here are a couple to get started: Learn the Linux command line. Write shell scripts.
    Bash Prompt HOWTO

    Also make sure you're saving the files as plain text if you're using TextEdit. You might want to consider using Nano in Terminal instead.
    To run the script, make sure the file is excutable (chmod +x filename) and preface the filename with a ./ to run it. This will tell the shell the file is in the current directory.

  3. #3

    IvanLasston's Avatar
    Member Since
    Feb 26, 2010
    Rocky Mountain High, Colorado
    1.8 GHz i7 MBA 11" OSX 10.8.2
    First you have to figure out where perl is -
    which perl
    Make sure that matches what you put in the #! line - mine is actual in /opt/local/bin

    If you want to run the script you have to set it to executable
    chmod 755
    Then you can do
    Which should run.

    Here is a little more info on permissions
    Linux and UNIX chmod command help

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Month in Terminal is in Russian - only in Terminal!
    By yoandrew in forum macOS - Operating System
    Replies: 4
    Last Post: 12-29-2012, 09:20 AM
  2. Terminal Help?
    By gts1117 in forum macOS - Operating System
    Replies: 2
    Last Post: 08-20-2012, 09:25 AM
  3. Terminal Help
    By LMCLUMD in forum macOS - Development and Darwin
    Replies: 1
    Last Post: 06-15-2011, 04:08 AM
  4. help!! terminal os 10.5.8
    By alcohol in forum macOS - Operating System
    Replies: 10
    Last Post: 04-10-2011, 12:35 PM
  5. using terminal
    By mayflyTR in forum macOS - Operating System
    Replies: 3
    Last Post: 08-22-2010, 05:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts