Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell script help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Hyper" data-source="post: 1240185" data-attributes="member: 202399"><p>Hi all,</p><p>I'm kinda new to making bash scripts and I need some help. This is what I have:</p><p></p><p>[CODE]#!/bin/bash</p><p></p><p>echo "What is the name:"</p><p>read HI_FILE</p><p></p><p>echo "$HI_FILE"</p><p></p><p>exit[/CODE]</p><p></p><p>However, when I go into terminal and do </p><p>sh test.sh (thats the name of the file), it'll give me:</p><p></p><p>: command not found</p><p>What is the name:</p><p></p><p>Then I type something, press enter and it'll reply with:</p><p></p><p></p><p>': not a valid identifierI_FILE</p><p>: command not found</p><p></p><p>: command not found</p><p></p><p></p><p>What am I doing wrong??</p></blockquote><p></p>
[QUOTE="Hyper, post: 1240185, member: 202399"] Hi all, I'm kinda new to making bash scripts and I need some help. This is what I have: [CODE]#!/bin/bash echo "What is the name:" read HI_FILE echo "$HI_FILE" exit[/CODE] However, when I go into terminal and do sh test.sh (thats the name of the file), it'll give me: : command not found What is the name: Then I type something, press enter and it'll reply with: ': not a valid identifierI_FILE : command not found : command not found What am I doing wrong?? [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell script help
Top