Thread: Problem with executing my first bash script
hi,
iv started learning bash scripting tutorial:
http://www.linuxcommand.org/wss0030.php
here did:
my problem in terminal can run script, , du command works regard other user directories.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_
when try make
i permission denied du command on other users directories.code:make_page > page.html
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
Post a Comment