Search the Community
Showing results for tags 'bash'.
-
hello dear community I’m trying to capture the output of the top command into a file. When I execute top > output.txt, the output.txt file contains lot of junk characters. What is the best method to capture the output of the top command into a readable text file? i tried to use the top command batch mode operation option ( -b ) to capture the top command output into a file. top -n 1 -b > top-output.txt or this one less top-output.txt but - unfotunatly they do not work for me... : linux-a9sq:/home/martin # -n 1 > top-output.txt -n: command not found linux-a9sq:/home/martin # top-output.txt If 'top-output.txt' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf top-output.txt linux-a9sq:/home/martin # top -n 1 -b > top-output.txt linux-a9sq:/home/martin # top -n1 -b | head5 If 'head5' is not a typo you can use command-not-found to lookup the package that contains it, like this: cnf head5 linux-a9sq:/home/martin # what can i do!? love to hear from you greetings
-
I have been developing in PHP for quite some time now and only recently started getting into bash/server scripting. My question, is there any practical use to use bash scripts with PHP? Do any enterprise level applications use it? To my understanding, it can be used as a link to tie multiple languages together like RUBY, PYTHON, PHP, PERL etc. i.e. `ruby my_useful_ruby_script.rb` // <- does something incredibly cool that PHP fails at?? WOULD THIS BE PRACTICAL?? SECRUTIY ISSUES? Do you use shell scripts in your code to do cool things?? Let me know
- 1 reply
-
- shell_exec
- bash
-
(and 2 more)
Tagged with:
-
I've written a basic bash script to test SSMTP, SSMTP works fine, but the script I wrote doesn't send the message correctly clear echo "sending mail" echo "who are you sending it to?" read $to echo echo "excellent, now what is the subject?" read $subject echo echo "marvelous, now write a quick message:" read $message echo To: $to > mail.txt echo From: emailbox >> mail.txt echo Subject: .$subject >> mail.txt echo $message >> mail.txt clear echo "ok, I will send this message for you..." ssmtp $to < mail.txt echo "message sent successfully!" thsi just creates the file without the variables in it for some reason can anyone spot where I've gone wrong? thanks