Guest User

Untitled

a guest
Jan 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. total 40
  2. 36 -rwxrwxr-x 1 amit amit 36720 2012-03-31 12:19 1.txt
  3. 4 -rwxrwxr-x 1 amit amit 1318 2012-03-31 14:49 2.txt
  4.  
  5. i=0
  6. ls -ls | while read line
  7. do
  8. array[ $i ]="$line"
  9. (( i++ ))
  10. done
  11.  
  12. #! /bin/bash
  13.  
  14. i=0
  15. while read line
  16. do
  17. array[ $i ]="$line"
  18. (( i++ ))
  19. done < <(ls -ls)
  20.  
  21. echo ${array[1]}
  22.  
  23. files=(*)
  24.  
  25. OIFS=$IFS; IFS=$'n'; array=($(ls -ls)); IFS=$OIFS; echo "${array[1]}"
  26.  
  27. files=($(find -E . -type f -regex "^.*$"))
  28. for item in ${files[*]}
  29. do
  30. printf " %sn" $item
  31. done
  32.  
  33. IFS=' ' read -r -a array <<< $(ls /path/to/dir)
Add Comment
Please, Sign In to add comment