Advertisement
paperline27

pembuatan.index.html.pake.C.Shell.csh

Feb 28th, 2024 (edited)
1,061
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.81 KB | Source Code | 0 0
  1. #!/bin/csh
  2.  
  3. # Nama file
  4. set file_name = "index.html"
  5.  
  6. # Membuat atau mengosongkan file index.html
  7. > "$file_name"
  8.  
  9. # Meminta pengguna untuk memasukkan judul halaman
  10. echo "Masukkan judul halaman: "
  11. set page_title = "$<"
  12.  
  13. # Meminta pengguna untuk memasukkan konten paragraf
  14. echo "Masukkan konten paragraf: "
  15. set paragraph_content = "$<"
  16.  
  17. # Menambahkan konten ke dalam file index.html
  18. echo "<!DOCTYPE html>" >> "$file_name"
  19. echo "<html>" >> "$file_name"
  20. echo "<head>" >> "$file_name"
  21. echo "    <title>$page_title</title>" >> "$file_name"
  22. echo "</head>" >> "$file_name"
  23. echo "<body>" >> "$file_name"
  24. echo "    <h1>$page_title</h1>" >> "$file_name"
  25. echo "    <p>$paragraph_content</p>" >> "$file_name"
  26. echo "</body>" >> "$file_name"
  27. echo "</html>" >> "$file_name"
  28.  
  29. echo "File index.html berhasil dibuat."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement