Wednesday, 15 February 2012

Should this be done with bash script or automator or applescript? -


I have a command that has a variable in a file that updates the firmware for specific hardware and gives it a serial number

  # / bin / bash fpath = $ (dirname "$ 0") ee_image = MLR-2000119. bin sudo NVRAM TBT-option = 4 sudo / usr / sbin / bless -mount / - Firmware "$ fpath / ThorUtilDevice.efi" -payload "$ fpath / $ ee_image" -options "-o-ej 1 -blast EFI- payload0-data of apple" sudo reboot now   

I would like to create a file through an automator or apple which is the same file Naaga but automatically ee_image bin file name will increase by one. Because the end user does not always have to open the command file in text editing, make the changes manually and then execute the file.

Any help with this must be sent to a god.

The last line in your script sudo reboot now any kind of loop is meaningless Will happen .

However, if you insist, you can use a loop:

  # / bin / bash fpath = $ (dirname "$ 0") for i {2,000,119 in .3000119}; Such ee_image = MLR - $ {i} .bin sudo NVRAM TBT-option = 4 sudo / usr / sbin / bless -mount / -firmware "$ fpath / ThorUtilDevice.efi" -payload "$ fpath / $ ee_image" -options " -o -ej 1 -blast EFI- payload0-data of apple "sudo reboot now done   

mlr-2000119. bin via it will loop MLR-3000119 . You can also consider passing a logic to the script in which case you can use your original script with ee_image as the line

  ee_image = Mlr- $ 1.bin   

and invoke / path / to / your / script 2000119

No comments:

Post a Comment