1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dos Batch to Shell Script

Discussion in 'Shell Script' started by Datwal, Aug 28, 2010.

  1. Datwal

    Datwal New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    How to convert following dos batch code to unix shell:-

    echo Database username and password will be taken from liquibase.properties file....
    setlocal ENABLEEXTENSIONS
    for /f "tokens=1* delims==" %%a in (liquibase.properties) do (
    if "%%a"=="username" set dbuser=%%b
    if "%%a"=="password" set dbpwd=%%b
    if "%%a"=="url" set dburl=%%b
    )
    echo.
    echo UserName is:=%dbuser%
    echo PassWord is:=%dbpwd%
    echo URL is:=%dburl%
    echo.
    if not %errorlevel%==0 goto ON_FILE_READ_ERROR



    Regards
    Dattatraya
     

Share This Page