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 scripting
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="xstep" data-source="post: 255501" data-attributes="member: 11647"><p>I'm not really sure what your looking for, but try the below sample. Don't forget to make it executable.</p><p></p><p>I named the script test.sh in my root directory, cd'd to /tmp, and typed;</p><p> ~/test.sh -font 35</p><p></p><p></p><p>#!/bin/sh</p><p></p><p>echo $0 #this is the path as typed to run this script.</p><p>echo $1 $2 #there are the two variables passed in</p><p></p><p>mypwd=`pwd` #get the present working directory the user executed this from.</p><p>echo $mypwd #echo the present working directory.</p><p></p><p>exit</p></blockquote><p></p>
[QUOTE="xstep, post: 255501, member: 11647"] I'm not really sure what your looking for, but try the below sample. Don't forget to make it executable. I named the script test.sh in my root directory, cd'd to /tmp, and typed; ~/test.sh -font 35 #!/bin/sh echo $0 #this is the path as typed to run this script. echo $1 $2 #there are the two variables passed in mypwd=`pwd` #get the present working directory the user executed this from. echo $mypwd #echo the present working directory. exit [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
Shell scripting
Top