zoukankan      html  css  js  c++  java
  • Linux_联合仿真(获取当前执行文件父路径)

    #!/bin/sh
    basepath=$(cd `dirname $0`; pwd)       #获取当前文件所在路径
    echo $basepath     #打印当前文件所在路径
    cd $basepath            #切换到该路径
    export LD_LIBRARY_PATH=./   #添加库路径
    
    ./Middleware     #执行程序
    #mac地址设置
    ifconfig eth0 down
    ifconfig eth0 hw ether f0:de:f1:05:d8:38
    ifconfig eth0 up

     1.切换用户

    #!/bin/sh
    sudo -i
    expect "password:"  
    send "123"  
    interact 

    2.修改mac地址和时间

    #!/bin/sh
    
    ifconfig eth0 down
    ifconfig eth0 hw ether f0:de:f1:05:d8:38
    ifconfig eth0 up
    
    date -s 2018-07-07

    3.执行脚本

    #!/bin/sh
    
    ifconfig eth0 down
    ifconfig eth0 hw ether f0:de:f1:05:d8:38
    ifconfig eth0 up
    
    cd /home/ubuntu/Desktop/qualnet20190903
    basepath=`pwd`               #$(cd `dirname $0`; pwd) #获取当前文件所在路径
    echo $basepath     #打印当前start.sh文件所在路径 
    cd $basepath/Turing           #切换到该路径
    
    export QUALNET_HOME=`pwd`
    echo $QUALNET_HOME
    export PATH=$PATH:$QUALNET_HOME/bin:$basepath/Turing/bin:$PATH
    
    export LD_LIBRARY_PATH=$QUALNET_HOME/gui/lib/linux64:$basepath/Lib/bin:$basepath/ExtraLib:/home/ubuntu/Program/Qt5.9.5/5.9.5/gcc_64/lib:$LD_LIBRARY_PATH   
    
    cd scenarios/IEEE39-28
    qualnet IEEE39-28.config

    4.执行带参数脚本

    #!/bin/sh
    
    ifconfig eth0 down
    ifconfig eth0 hw ether f0:de:f1:05:d8:38
    ifconfig eth0 up
    
    cd /home/ubuntu/Desktop/qualnet20190903
    basepath=`pwd`               #$(cd `dirname $0`; pwd) #获取当前文件所在路径
    echo $basepath     #打印当前start.sh文件所在路径 
    cd $basepath/Turing           #切换到该路径
    
    export QUALNET_HOME=`pwd`
    echo $QUALNET_HOME
    export PATH=$PATH:$QUALNET_HOME/bin:$basepath/Turing/bin:$PATH
    
    export LD_LIBRARY_PATH=$QUALNET_HOME/gui/lib/linux64:$basepath/Lib/bin:$basepath/ExtraLib:/home/ubuntu/Program/Qt5.9.5/5.9.5/gcc_64/lib:$LD_LIBRARY_PATH   
    
    cd scenarios/$1
    qualnet $2
  • 相关阅读:
    SpringCloud--Ribbon--源码解析--Ribbon入口实现
    SpringCloud--Ribbon--使用demo
    装饰着模式(Decorator Pattern)
    SpringCloud--Eureka--配置
    SpringCloud--Eureka--原理及源码解析
    SpringCloud--Eureka--搭建
    观察者模式(Observer Pattern)
    策略模式(Strategy Pattern)
    xeus-clickhouse: Jupyter 的 ClickHouse 内核
    Spring的学习与实战(续)
  • 原文地址:https://www.cnblogs.com/mathyk/p/10540131.html
Copyright © 2011-2022 走看看