Suppose I want to copy a file:
  scp abc root@10.10.1.1:/home/user/app_abc
is开发者_运维问答 there a way can simplfy this command ,something like :
  scp abc root@10.10.1.1:/home/user/app_%1
BTW: I don't want to write a shell for it
Thanks
You don't have to write separate script file but you can always write one liner:
name=abc;cp $name app_$name
Did you mean scp by the way? I never used cp with this notation.
Try the following:
export BOO="abc" && scp $BOO root@10.10.1:/home/user/app_$BOO
you can have this command in script file (copy.sh) and use it with any file name you want as an input argument. you just need to follow the instruction :
- Create the the Bash Script File : - $ gedit copy.sh 
- Add your code to file and save it: - #!/bin/sh - scp $1 root@10.10.1.1:/home/user/app_$1 
- Make file executable for any one : - $ chmod 777 copy.sh 
- And execute it: - $ ./copy.sh abc 
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论