Home > OS >  For help, known in wang directory has 1.. 5. TXT five suffix called. TXT file
For help, known in wang directory has 1.. 5. TXT five suffix called. TXT file

Time:09-30

Asked to write a shell script, this directory will be under 5. TXT file batch into suffix called. Pub file

CodePudding user response:

#!/bin/bash

DIR=//* * * * * */wang
CD $DIR
Rename. TXT. Pub *. TXT


DIR is the absolute path to your directory, replace it

CodePudding user response:

reference 1st floor zhouchao6 response:
#!/bin/bash

DIR=//* * * * * */wang
CD $DIR
Rename. TXT. Pub *. TXT


DIR is the absolute path to your directory, it is good to replace the

If you want to use a for loop should be in the form of how to write

CodePudding user response:

refer to the second floor qq_42387829 response:
Quote: refer to 1st floor zhouchao6 response:
#!/bin/bash

DIR=//* * * * * */wang
CD $DIR
Rename. TXT. Pub *. TXT


DIR is the absolute path to your directory, it is good to replace the

If you want to use a for loop should be in the form of how to write ah


 
For I in {1.. 5}
Do
The mv $i.t xt $i.p ub
The done

CodePudding user response:

Brothers, that what I mean

CodePudding user response:

reference 4 floor qq_42387829 response:
brothers, that what I mean ah

Variables:

The for loop
Grammar:
For the variable name in a variable's value list
Do
Action
.
done

CodePudding user response:

reference 5 floor zhouchao6 reply:
Quote: refer to 4th floor qq_42387829 response:

Brother, what do you mean that I ah

Variables:

The for loop
Grammar:
For the variable name in a variable's value list
Do
Action
.
The done

I know that is a variable, just can't remember whether $I special variables, is their own set of pure

CodePudding user response:

Reference
I know is a variable, just can't remember whether $I special variables, is their own set of pure

Well, the custom variable names, you had the following action on the variable name corresponding
  • Related