How to create script to change directory then run
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Evening all
I am trying to get a simple script to work that I can run from the desktop or have it load on login. All i want it to do is change do the directory /users/me/sites/sass and then run the command 'npm run compile:sass' thats it. I have tried automator but it throws out an error and wont run, i just tried to save it as an application with a run shell script option and put the above in.
Would be grateful for any advice, seems a pretty simple thing but just cant get it to play.
Thanks guys
shell-script terminal osx
add a comment |Â
up vote
0
down vote
favorite
Evening all
I am trying to get a simple script to work that I can run from the desktop or have it load on login. All i want it to do is change do the directory /users/me/sites/sass and then run the command 'npm run compile:sass' thats it. I have tried automator but it throws out an error and wont run, i just tried to save it as an application with a run shell script option and put the above in.
Would be grateful for any advice, seems a pretty simple thing but just cant get it to play.
Thanks guys
shell-script terminal osx
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Evening all
I am trying to get a simple script to work that I can run from the desktop or have it load on login. All i want it to do is change do the directory /users/me/sites/sass and then run the command 'npm run compile:sass' thats it. I have tried automator but it throws out an error and wont run, i just tried to save it as an application with a run shell script option and put the above in.
Would be grateful for any advice, seems a pretty simple thing but just cant get it to play.
Thanks guys
shell-script terminal osx
Evening all
I am trying to get a simple script to work that I can run from the desktop or have it load on login. All i want it to do is change do the directory /users/me/sites/sass and then run the command 'npm run compile:sass' thats it. I have tried automator but it throws out an error and wont run, i just tried to save it as an application with a run shell script option and put the above in.
Would be grateful for any advice, seems a pretty simple thing but just cant get it to play.
Thanks guys
shell-script terminal osx
asked Nov 5 '17 at 19:53
rufus
1114
1114
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
First, get it to work from the command line, so you know everything is working as it should, then focus on running that script from your gui.
Step 1 - create the script
echo "cd /users/me/sites/sass ; npm run compile: sass" >> /users/me/myscript
Step 2 - make the script executable
chmod 775 /users/me/myscript
Step 3 - run it and confirm proper operation
. /users/me/myscript
Step 4 - add a link to the script from your gui
(gui dependent, sorry, can't help you here)
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
First, get it to work from the command line, so you know everything is working as it should, then focus on running that script from your gui.
Step 1 - create the script
echo "cd /users/me/sites/sass ; npm run compile: sass" >> /users/me/myscript
Step 2 - make the script executable
chmod 775 /users/me/myscript
Step 3 - run it and confirm proper operation
. /users/me/myscript
Step 4 - add a link to the script from your gui
(gui dependent, sorry, can't help you here)
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
add a comment |Â
up vote
0
down vote
First, get it to work from the command line, so you know everything is working as it should, then focus on running that script from your gui.
Step 1 - create the script
echo "cd /users/me/sites/sass ; npm run compile: sass" >> /users/me/myscript
Step 2 - make the script executable
chmod 775 /users/me/myscript
Step 3 - run it and confirm proper operation
. /users/me/myscript
Step 4 - add a link to the script from your gui
(gui dependent, sorry, can't help you here)
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
add a comment |Â
up vote
0
down vote
up vote
0
down vote
First, get it to work from the command line, so you know everything is working as it should, then focus on running that script from your gui.
Step 1 - create the script
echo "cd /users/me/sites/sass ; npm run compile: sass" >> /users/me/myscript
Step 2 - make the script executable
chmod 775 /users/me/myscript
Step 3 - run it and confirm proper operation
. /users/me/myscript
Step 4 - add a link to the script from your gui
(gui dependent, sorry, can't help you here)
First, get it to work from the command line, so you know everything is working as it should, then focus on running that script from your gui.
Step 1 - create the script
echo "cd /users/me/sites/sass ; npm run compile: sass" >> /users/me/myscript
Step 2 - make the script executable
chmod 775 /users/me/myscript
Step 3 - run it and confirm proper operation
. /users/me/myscript
Step 4 - add a link to the script from your gui
(gui dependent, sorry, can't help you here)
answered Nov 5 '17 at 21:23
captcha
771614
771614
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
add a comment |Â
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
In addition, for the "or load on login" ... with the tag of OSx... SuperUser MacOSx Run Command on Startup Question
â RubberStamp
Nov 5 '17 at 21:30
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f402714%2fhow-to-create-script-to-change-directory-then-run%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password