Home > OS >  Excuse me add the shell command in the for loop: why can't I run
Excuse me add the shell command in the for loop: why can't I run

Time:09-16

A single execution


` ` `
Imex_batch [filename] [parameter1] [parameter2] [parameter3]...
` ` `

Can run, but like this to the for loop directly say is can't find command, how be to return a responsibility?



` ` `
#!/bin/bash
PATH="/home/customer/Desktop/2 t/publish_program IMEX2.1/seq"
CD $PATH
For I in *. Fasta
Do
Imex_batch $I 0 0 0 0 0 0 0 0 0 0 0 0 6 3 3 3 3 3 1 0 0 0 0 0 0;
The done
` ` `

CodePudding user response:

Linux PATH is the system environment variables, it contains the PATH of the system commands you want (you can echo $PATH to see), you will go to the PATH command system of execution to find below, now you define the PATH to/home/customer/Desktop/2 t/publish_program/IMEX2.1/seq, system will only go to the directory to find imex_batch command, but your order under the/usr/bin, obviously can not find,
Shell variables don't use some key words, you can replace a variable name

CodePudding user response:

reference 1st floor zhouchao6 response:
Linux PATH is the system environment variables, it contains the PATH of the system commands you want (you can echo $PATH to see), execute command system will you go to the PATH below, you now define the PATH to/home/customer/Desktop/2 t/publish_program/IMEX2.1/seq, system will only go to the directory to find imex_batch command, but your order under the/usr/bin, obviously can not find,
Shell variables don't use some key words, you can replace a variable name

Ok, thanks, but I found that the main problem is not this, but the whole shell command was not continuous input, so the cycle also loses the meaning

CodePudding user response:

https://gitee.com/faith01238/shells/blob/master/for/for_in.sh
You can consider the following example here,
  • Related