Command on new line

Cameron

I have the following command: cd ../../game ^ electron src that I need to run.

Which basically means step up two folders from our current directory then into the game folder and call electron on the src folder.

However it sees the electron src command as part of the cd command... and gives the error can't find the path specified

How can I break it up? so put the electron src AFTER the cd command.

This command gets executed inside a NodeJS application like:

exec('cd ../../game ^ electron src', function(...

As you can see I have tried the ^ to break it up but that doesn't seem to solve the problem... I have tried the same code in a Windows command prompt and it happens there so it's not because of the way NodeJS executes it.

DavidPostill

How do I run one command then run another?

Use the following command:

cd ../../game & electron src

The & means run the first command then run the second.

If you think the first command might fail then use && instead.


What is the syntax for command redirection?

  • command > filename Redirect command output to a file

  • command >> filename APPEND into a file

  • command < filename Type a text file and pass the text to command

  • commandA | commandB Pipe the output from commandA into commandB

  • commandA & commandB Run commandA and then run commandB

  • commandA && commandB Run commandA, if it succeeds then run commandB

  • commandA || commandB Run commandA, if it fails then run commandB

Source Redirection


Further reading

An A-Z Index of the Windows CMD command line is an excellent reference for all things Windows cmd line related.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Starting new line in AppendAllText command

From Dev

New line after the command prompt

From Dev

zsh new line prompt after each command

From Dev

multiline ksh command just goes to a new line

From Dev

Use the command line to make new objects

From Dev

Open URLs in a new tab from command line

From Dev

New line command on osx python 2.7

From Dev

How to open a new tab in the server command line?

From Dev

How to open a new tab in the server command line?

From Dev

zsh new line prompt after each command

From Dev

Adding a new comment to Jira via the command line

From Dev

multiline ksh command just goes to a new line

From Dev

Bash script interpreting line continuation as a new command

From Dev

My echo command for new line is not working

From Dev

Installing a new package from command line

From Dev

Remove extra new line from cygwin command line

From Dev

New prompt line not automatically put to command line upon exit code

From Dev

Storing command output lines into array based on new line character

From Dev

Open new tab in existing meld instance via a command line

From Dev

Trailing new line after piping to a command: is there any standard?

From Dev

xen create new virtual machine using command line

From Dev

sed: Why does command q add a new line?

From Dev

How to launch a new instance of Google Chrome from the command line?

From Dev

wait for command line program execution before issuing new action in AppleScript

From Dev

How can I add a new user as sudoer using the command line?

From Dev

How can I disable the new NPM spinner in the command-line?

From Java

How to extract part of a document and save it to a new one (command line Mac)

From Dev

Open chrome in windows from the command line in a new window

From Dev

Is it possible to create new user profile by using command line for Chrome?

Related Related

  1. 1

    Starting new line in AppendAllText command

  2. 2

    New line after the command prompt

  3. 3

    zsh new line prompt after each command

  4. 4

    multiline ksh command just goes to a new line

  5. 5

    Use the command line to make new objects

  6. 6

    Open URLs in a new tab from command line

  7. 7

    New line command on osx python 2.7

  8. 8

    How to open a new tab in the server command line?

  9. 9

    How to open a new tab in the server command line?

  10. 10

    zsh new line prompt after each command

  11. 11

    Adding a new comment to Jira via the command line

  12. 12

    multiline ksh command just goes to a new line

  13. 13

    Bash script interpreting line continuation as a new command

  14. 14

    My echo command for new line is not working

  15. 15

    Installing a new package from command line

  16. 16

    Remove extra new line from cygwin command line

  17. 17

    New prompt line not automatically put to command line upon exit code

  18. 18

    Storing command output lines into array based on new line character

  19. 19

    Open new tab in existing meld instance via a command line

  20. 20

    Trailing new line after piping to a command: is there any standard?

  21. 21

    xen create new virtual machine using command line

  22. 22

    sed: Why does command q add a new line?

  23. 23

    How to launch a new instance of Google Chrome from the command line?

  24. 24

    wait for command line program execution before issuing new action in AppleScript

  25. 25

    How can I add a new user as sudoer using the command line?

  26. 26

    How can I disable the new NPM spinner in the command-line?

  27. 27

    How to extract part of a document and save it to a new one (command line Mac)

  28. 28

    Open chrome in windows from the command line in a new window

  29. 29

    Is it possible to create new user profile by using command line for Chrome?

HotTag

Archive