Posted By

vorp on 06/30/10


Tagged

Bash loop rename


Versions (?)

Bash looping


 / Published in: Bash
 

Basic bash loop structure

  1. for i in *.JPG; do echo $i; done
  2.  
  3. #!/bin/bash
  4. echo "Bash version ${BASH_VERSION}..."
  5. for i in {0..10..2}
  6. do
  7. echo "Welcome $i times"
  8. done
  9.  
  10. # s="great song.flac"
  11. # echo ${s/ //}
  12. great/song.flac
  13. # echo ${s/ /}
  14. greatsong.flac
  15. # echo ${s// /}
  16. greatsong.flac

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: vorp on June 30, 2010

!/bin/bash

echo "Bash version ${BASH_VERSION}..." for i in {0..10..2} do echo "Welcome $i times" done

Posted By: vorp on July 8, 2010

s="great song.flac"

echo ${s/ //}

great/song.flac

echo ${s/ /}

greatsong.flac

echo ${s// /}

greatsong.flac

You need to login to post a comment.