| |

VerySource

 Forgot password?
 Register
Search
View: 2571|Reply: 10

Add a semicolon ";" after the unix command, will it affect the command?

[Copy link]

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-4 02:50:01
| Show all posts |Read mode
I'm new to unix
Reply

Use magic Report

0

Threads

23

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-1-4 11:21:01
| Show all posts
No effect
This symbol was originally designed to execute multiple commands
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-19 12:09:01
| Show all posts
An OS written in C is like when you write C C ++; the semicolon is used as a sign of the end of the statement!
void fun ();


int main ()
{
  fun ();
  return 0;
}


void fun ()
{

  ;;; // Semicolon generates empty function body;
}
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-8-4 09:00:01
| Show all posts
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-8-4 09:15:02
| Show all posts
I don’t know if I can describe it clearly. For example, the shutdown -h now; and no semicolon, is there any difference? Thank you
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-5 00:15:01
| Show all posts
biokrunchbiokrunch=;
Reply

Use magic Report

1

Threads

4

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-8-18 11:45:01
| Show all posts
I don’t know if I can describe it clearly. For example, the shutdown -h now; and no semicolon, is there any difference? Thank you
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-18 12:00:01
| Show all posts
Add; is to execute the command continuously.
Such as ls;make;cd -;make
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-18 13:00:01
| Show all posts
Shutdown -h now; and no semicolon, is there any difference?

no difference
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-18 14:15:01
| Show all posts
The semicolon is mainly used to separate multiple commands in sequence at the same time.
Adding a semicolon when executing a command can be understood as executing an empty command after executing this command
The result is the same
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list