Mayur_Pipaliya

Testing Shell Script :|

Feb 22nd, 2012
139
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. #Command to view list of files..
  4. var_list=`ls -lrt /path/infy/ |grep "$cdate"| awk '{print $9}'`
  5.  
  6. #Command to store file list in array..
  7. array_of_file=($var_list)
  8.  
  9.  
  10. if [[ `echo ${array_of_file[*]}` == "" ]]; then
  11.          print "files not received"
  12. else
  13.  for i in `echo ${array_of_file[*]}`; do
  14.         print "files received. .. and extra procesing"
  15. done
  16. fi
  17.  
  18.  
  19. # To Sort array...
  20. unique_array=$(echo $array_of_file | sort -u)
  21. for a in ${unique_array[@]}; do
  22.     echo $a
  23. done
  24.  
  25.  
  26.  
  27. #ps: powerful linux commands and pipeline will work ;)
  28. #ref: http://ubuntuforums.org/showthread.php?t=969177
  29. #ref: http://www.java-samples.com/showtutorial.php?tutorialid=1374
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×