SHARE
TWEET

OS Assignment-1

a guest Dec 8th, 2019 117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. echo $1 $2 $3 $4 $5 $6'  <collecting the parameter arguments:'
  4. a=$1
  5. b=$2
  6. c=$3
  7.  
  8.   #start="$1";
  9.   #end="$3";
  10.  
  11. var=( {a..z} )
  12. for ((x=0; x<=2; x++)); do
  13.     mkdir "$var"    
  14.     var="${var[x+1]}"
  15.    
  16. done
  17.  
  18. if [ $a -gt $b -a $a -gt $c ]
  19. then
  20.  echo "$a is largest integer"
  21.  max=$a
  22. elif [ $b -gt $a -a $b -gt $c ]
  23. then
  24.  echo "$b is largest integer"
  25.  max=$b
  26. elif [ $c -gt $a -a $c -gt $b ];
  27. then
  28.  echo "$c is largest integer"
  29.  max=$c
  30.  
  31. fi
  32.  
  33. echo "maximum find : $max"
  34.  
  35.  
  36. if [ $max -eq $1 ]
  37. then
  38.    fol=a
  39. elif [ $max -eq $2 ]
  40. then
  41.    fol=b
  42.  
  43. else
  44.    fol=c
  45. fi
  46.  
  47. #fol="folder_$max"
  48.  
  49.  
  50.  
  51.  
  52. echo $fol
  53.  
  54.  
  55. cd $fol
  56. touch x.txt
  57.  
  58. for((i=1;i<=a;i++))
  59.    do echo -e "$4$4$4\n" >> x.txt
  60. done
  61.  
  62. for((i=1;i<=b;i++))
  63.    do echo -e "$5$5$5\n" >> x.txt
  64. done
  65.  
  66. for((i=1;i<=c;i++))
  67.    do echo -e "$6$6$6\n" >> x.txt
  68. done
  69.    
  70.  
  71. more x.txt
  72.  
  73. echo "------------------------"
  74. echo "$max"
  75.  
  76. if [ $max -eq $1 ]
  77. then
  78.    r=a
  79. elif [ $max -eq $2 ]
  80. then
  81.    r=b
  82.  
  83. else
  84.    r=c
  85. fi
  86.  
  87. echo "$r$r$r is replaced by ddd "
  88. echo "------------------------"
  89.  
  90. sed -i "s|$r$r$r|ddd|g" x.txt
  91. cat x.txt
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top