Skip to main content

Thread: Problem with executing my first bash script


hi,
iv started learning bash scripting tutorial:
http://www.linuxcommand.org/wss0030.php

here did:
code:
#!/bin/bash # make_page - script produce html file  title="system information for" right_now=$(date +"%x %r %z") time_stamp="updated on $right_now $user"  # functions... function system_info {     echo "system_info" }  function show_uptime {     #echo "system_uptime"     uptime }  function drive_space {     echo "<h2>system_space</h2>"     df }  function home_space {     echo "<h2>home directory space user</h2>"     echo "<pre>"     echo "bytes directory"     du -sh /home/* | sort -n     echo "</pre>"  }  # main cat <<- _eof_     <html>     <head>         <title>         $title $hostname         </title>     </head>      <body>     <h1>$title $hostname</h1>     <p>$time_stamp</p>     $(system_info)     $(show_uptime)     $(drive_space)     $(home_space)     </body>     </html> _eof_
my problem in terminal can run script, , du command works regard other user directories.

when try make

code:
make_page > page.html
i permission denied du command on other users directories.

cant sudo


highly appreciated.

thank

i'm trying understand what's going on here, i'm struggling.

post exact error messages when run make_page > page.html


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] Problem with executing my first bash script


Ubuntu

Comments

Popular posts from this blog

invalid use of void expresion in FlexiTimer2 library

error: a function-definition is not allowed here before '{' token

LED Strip Code