Find the answer to your Linux question:
Results 1 to 2 of 2
im having trouble with a writing a script in my red hat linux class...could anyone help? Create a short executable bash script named ~/bin/ispython, which expects a single argument, which ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Posts
    1

    script trouble

    im having trouble with a writing a script in my red hat linux class...could anyone help?

    Create a short executable bash script named ~/bin/ispython, which expects a single argument, which is a filename. If the supplied filename's first line is exactly "#!/usr/bin/python" (nothing more, nothing less), the script should print the number 1. Otherwise, the script should print the number 0.

    I know i have to use the head and grep commands

    please help

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    Bash Scripting

    Forum Rules

    4. No homework questions

Posting Permissions

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