Link to home
Start Free TrialLog in
Avatar of Shamsul Kamal
Shamsul Kamal

asked on

How to convert MSDOS Batch file to Linux Bash ?

Hi,

May i know how to convert the following MSDOS Batch File to linux BASH Script ?

@echo off
for /F "skip=3 usebackq tokens=*" %%i in (`cmd /c "vzlist -ao veid"`) do (cmd /c "vzbackup "%%i && echo VE ID %%i has been backed up!)

Hope anybody can help.

Thanks.


Avatar of Beholdason
Beholdason
Flag of United Kingdom of Great Britain and Northern Ireland image

Avatar of Shamsul Kamal
Shamsul Kamal

ASKER

Ehm...thanks but, it seems difficult to me.

Anybody else who can help ?
ASKER CERTIFIED SOLUTION
Avatar of amit_g
amit_g
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi,

I alter your code to :

#!/bin/bash

for i in $(vzlist -ao veid | more +2)
do
      vzbackup $i && echo "VE ID $i has been backed up!"
done

and it works fine .

Thanks.

Thanks