Tags » Bash

bash : Loop over lines in file with user prompt

I used the following to loop over the lines in a file, while prompting the user for a key press on each iteration:

while read -u 3 line ; do 
  #clear the screen
  printf "\033c" 
  echo "$line"; echo

  # do something with the $line here

  read -n 1 -s -p ""
done 3< "some-file.txt"
… 27 more words
Coding

Resources

//  .bash  //  iterm2 setup  //  Customize your shell and command prompt  //  Tuts+ tutorial for command line //  bash profile generator  //  Command line for  25 more words

Research

Rename all JPG extensions to jpg using BASH script

This is what I did to rename the extensions:

for file in *.JPG
do
    mv "$file" "${file%.JPG}.jpg"
done
Shell

Bash - Here Documents

here document allow input to be redirected to an interactive command.

Example:

cat << !
file
file2
file3
!

In order to redirect the command (in this case… 33 more words

UNIX

How to create a REST client to POST a JSON object to a server and receive the data in Java

I just went through a lot of internet search in order to do exactly what the title says, looks like in the Java world you need to have always a IDE like Eclipse, or even worse, Netbeans, but sometimes I just need to test a concept and I don’t want to create a project for it. 99 more words

How do I embed multiple sizes in an .ico file? - Super User

Scripts are soooo coool.

I remember doing similar things in Windows, but couldn’t find the batch files any more. There is an example (thanks Rob W… 191 more words

Development