Sponsored Content
Top Forums UNIX for Dummies Questions & Answers shell script with parameters? Post 302510238 by ubu-user on Saturday 2nd of April 2011 09:03:10 AM
Old 04-02-2011
shell script with parameters?

hi , I wanted to create a script, and I have no idea how to, and I would appreciate any help on that. Any advice on solving this is welcome. Thanks

Here it goes:
make a shell script in bash that show the activity of users. The results should be a summary or a complete report in a file. Everything should be indicated by these parameters: -a showing the users' files modified in the last 24 hours
-p showing the processes separated by execution status for each user
-/ show how many connections and total time have done the users in the last week
-c nn, shows the last nn executed commands for each user in terminals.
--u user, verify that these are real system users otherwise show an error
-t hh:mm, indicate the interval whenever the script is executed to monitor the users.
-f file, file where the report should be saved for each user.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Number of parameters to a shell script

Is there any restriction on number of parameters can be passed on to the shell script? I found, after 9th parameter for parameter 10, it is taking parameter 1. (1 Reply)
Discussion started by: videsh77
1 Replies

2. Shell Programming and Scripting

help me in sending parameters from sqlplus script to unix shell script

Can anybody help me out in sending parameters from sql*plus script to unix shell script without using flat files.. Initially in a shell script i will call sql*plus and after getting some value from some tables, i want that variable value in unix shell script. How can i do this? Please tell me... (2 Replies)
Discussion started by: Hara
2 Replies

3. Shell Programming and Scripting

Calling sql in shell script with parameters

Dear All, I want to call an sql script within a unix shell script. I want to pass a parameter into the shell script which should be used as a parameter in teh sql script. e.g $ ./shell1.sh 5000129 here 5000129 is a prameter inside shell script i am calling one sql script e.g. ... (2 Replies)
Discussion started by: Radhe
2 Replies

4. Shell Programming and Scripting

Accessing the parameters of a shell script

Hi, I have one situation. I am developing a shell script to which parameters will be passed from a Web based User Interface using some Business Process(BP).There are some 6 parameters for which user will enter the values in UI. These values will be passed to script by BP in the form -... (2 Replies)
Discussion started by: The Observer
2 Replies

5. Shell Programming and Scripting

Parameters for function in Shell script

Hi, I am having a function inside a shell script. The Shell script is called with parameters and one of the parameter is passed to a SQL script inside the function. But when the function is called inside the shell script, the SQL script is not called. Do the shell parameter has to be... (3 Replies)
Discussion started by: srimenon09
3 Replies

6. Shell Programming and Scripting

want to pass parameters to awk script from shell script

Hello, I have this awk script that I want to execute by passing parameters through a shell script. I'm a little confused. This awk script removes duplicates from an input file. Ok, so I have a .sh file called rem_dups.sh #!/usr/bin/sh... (4 Replies)
Discussion started by: script_op2a
4 Replies

7. Shell Programming and Scripting

call another shell script and pass parameters to that shell script

Hi, I basically have 2 shell scripts. One is a shell script will get the variable value from the user. The variable is nothing but the IP of the remote system. Another shell script is a script that does the job of connecting to the remote system using ssh. This uses a expect utility in turn. ... (2 Replies)
Discussion started by: sunrexstar
2 Replies

8. Programming

csh: Parameters in Shell Script Help

I have a program that is designed to take the first parameter (a file extension) and use it to rewrite the file stored in the second paramerter with the new extension. And if the current file does not exist then the program will print an error message "No such file." For example, my program is... (1 Reply)
Discussion started by: Marhsall34
1 Replies

9. Shell Programming and Scripting

How can I fetch few parameters in Shell script?

Hi All, I want to fetch few details out of a huge output of AWS CLI tools : I am using this command : ec2-describe-instances (6 Replies)
Discussion started by: Palak Sharma
6 Replies

10. Shell Programming and Scripting

Shell script to create runtime variables based on the number of parameters passed in the script

Hi All, I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them abc.sh ---------- export Numbr_Parms=$# export a=1 while do export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
at(1)							      General Commands Manual							     at(1)

Name
       at, batch - execute commands at a later time

Syntax
       at time [day] [file]
       at -r job...
       at -l [job...]

       batch [file]

Description
       The  and commands use a copy of the named file (standard input default) as input to or at a later time.	A command to the current directory
       is inserted at the beginning, followed by assignments to all environment variables.  When the script is run, it uses the user and group	ID
       of the creator of the copy file.

       The command allows the user to specify when the commands should be executed, while jobs queued with execute when the load level of the sys-
       tem permits.

       The environment variables, current directory, and are retained when the commands are executed.  However, open files,  traps,  and  priority
       are lost.

       Users are permitted to use the and commands if their name appears in the file If that file does not exist, the file is checked to determine
       if the user should be denied access to and If neither file exists, only the superuser is allowed to submit a job.  If only the file  exists
       and is empty, global usage is permitted.  The files consist of one user name per line.

       The  time  is  1  to 4 digits.  It can, but does not have to be, followed by A, P, N or M which stand for AM, PM, noon or midnight, respec-
       tively. The A, P, N, and M suffixes are case-insensitive.  One and two digit numbers are interpreted as hours, three and four digits to	be
       hours  and  minutes. If three digits are specified, the first digit is interpreted to be an hour in the range 0-9, and the second and third
       digits as minutes.  If no letters follow the digits, a 24 hour clock time is presumed.

       In addition to 1-4 digits, and suffixes A, P, M, N, you can also specify:
       at hh:mm
       at h:mm
       at ham
       at hpm
       at noon
       at midnight

       The optional day is either a month name followed by a day number or by a day of the week.  If the word week  follows,  the  or  command	is
       invoked in seven days.  Both commands also recognize standard abbreviations for the days of the week and months of the year.  The following
       are examples of legitimate commands:
       at 8am jan 24

       at 1530 fr week

       The programs are executed by periodic execution of the command from The granularity of depends upon how often atrun is executed.  The  com-
       mand examines the file every minute.  The file determines when is executed.  The default is every 15 minutes on the 1/4 hour. Editing makes
       run more or less frequently.

       Standard output or error output is lost unless it is redirected.

       The and commands write the job number to standard error.

Options
       -r		   Removes jobs previously scheduled by or The number is the number reported at invocation by or  Only	the  superuser	is
			   allowed to remove another user's jobs.

       -l		   Lists all job numbers for all jobs submitted by the user issuing the command.  Even if the user is "root", only numbers
			   for jobs submitted by "root" are displayed.	To see the numbers of all jobs submitted, enter the following command:
			   % ls -l /usr/spool/at

Restrictions
       Due to the granularity of the execution of there may be bugs in scheduling jobs almost exactly 24 hours into the future.

Diagnostics
       Complains about various syntax errors and times that are out of range.

Files
       /usr/lib/atrun	   executor run by cron(8)

       in /usr/spool/at:
	    yy.ddd.hhhh.*  activity for year yy, day dd, hour hhhh.
	    lasttimedone   last hhhh
	    past	   activities in progress
       /usr/spool/at/at.allowlist of allowed users
       /usr/spool/at/at.denylist of denied users
       /usr/spool/at	   spool directory
       /usr/lib/cron	   XOPEN compatibility

See Also
       crontab(5), cron(8)

																	     at(1)
All times are GMT -4. The time now is 03:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy