Your issue is more to do with what ls gets for agrument when is shellscript:
for your script mls will because of $1 get ONLY 1 argument for that is what $1 stands for...
how to run a script using cron job and send the output as attachment via e-mail using unix. please help me.
how my cron job entry should be?
As of now my cron job entry is to run the script at specific time,
15 03 * * * /path/sample.sh | mail -s "Logs" email_id
In the above entry, what... (8 Replies)
Hi All,
I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file.
Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
If I run 'who -u' interactively or from a script invoked through bash in a tty on my Ubuntu 12LTS box I get an output like this:
testuser pts/0 Dec 9 02:32 . 2163 (host.xx.yy)
running the same through cron I get:
testuser pts/0 2012-12-09 02:32 00:05 2163... (2 Replies)
Hi Expert,
I have a .sh script in my home/new_dir/script.sh
This script creates number of output files at home/new_dir/email, home/new_dir/logs dir.
I am running this script using crontab (owner root).
Now this output files are getting created with
rw-r----- 1 root root
So if i... (2 Replies)
Hi All,
I have a script which checks the status of HP Smart Array & then emails me the output.
The script run fine when executed manually but I receive no output when configured in a cron job.
The script is below:
hpacucli ctrl slot=3 show config | mail -s "ARRAY STATUS-`date`"... (6 Replies)
I want to run sql query in shell script and output data save as delimited text (delimited text would be comma)
Code:
SPOOL_FILE=/pgedw/dan.txt
SQL=/pgedw/dan.sql
sqlplus -s username/password@myhost:port/servicename <<EOF
set head on
set COLSEP ,
set linesize 32767
SET TRIMSPOOL ON
SET... (8 Replies)
Hi Guys,
I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Hello Team .
I am working a health check script ( bash) to run on linux server ( RedHat) and requirements are
1. The o/p of script need to be send to two diff files . I am testing with tee command . But I am not successful yet , any recommendations if that is the right approach ?
2. The same... (2 Replies)
Experts,
I am writing a script and able to write only small piece of code and not able to collect logic to complete this task.
In input file have to look for name like like this (BGL_HSR_901_1AG_A_CR9KTR10) before sh iss neors. Record this (BGL_HSR_901_1AG_A_CR9KTR10) in csv file
Now have to... (0 Replies)
Discussion started by: as7951
0 Replies
LEARN ABOUT BSD
reboot
REBOOT(2) System Calls Manual REBOOT(2)NAME
reboot - reboot system or halt processor
SYNOPSIS
#include <sys/reboot.h>
reboot(howto)
int howto;
DESCRIPTION
Reboot reboots the system, and is invoked automatically in the event of unrecoverable system failures. Howto is a mask of options passed
to the bootstrap program. The system call interface permits only RB_HALT or RB_AUTOBOOT to be passed to the reboot program; the other
flags are used in scripts stored on the console storage media, or used in manual bootstrap procedures. When none of these options (e.g.
RB_AUTOBOOT) is given, the system is rebooted from file "vmunix" in the root file system of unit 0 of a disk chosen in a processor specific
way. An automatic consistency check of the disks is then normally performed.
The bits of howto are:
RB_HALT
the processor is simply halted; no reboot takes place. RB_HALT should be used with caution.
RB_ASKNAME
Interpreted by the bootstrap program itself, causing it to inquire as to what file should be booted. Normally, the system is booted
from the file "xx(0,0)vmunix" without asking.
RB_SINGLE
Normally, the reboot procedure involves an automatic disk consistency check and then multi-user operations. RB_SINGLE prevents the
consistency check, rather simply booting the system with a single-user shell on the console. RB_SINGLE is interpreted by the
init(8) program in the newly booted system. This switch is not available from the system call interface.
Only the super-user may reboot a machine.
RETURN VALUES
If successful, this call never returns. Otherwise, a -1 is returned and an error is returned in the global variable errno.
ERRORS
[EPERM] The caller is not the super-user.
SEE ALSO crash(8), halt(8), init(8), reboot(8)BUGS
The notion of ``console medium'', among other things, is specific to the VAX.
4th Berkeley Distribution May 9, 1985 REBOOT(2)