Sponsored Content
Full Discussion: Help me get some ideas
Top Forums Shell Programming and Scripting Help me get some ideas Post 302985760 by facepalm on Monday 14th of November 2016 11:39:25 PM
Old 11-15-2016
Help me get some ideas

Hello,
I have been given a scripting project, but have not learned any scripting. I need to get some ideas on how to start. Attached is part of the project:

I have no idea how to parse the arguments. What I had in mind was to get the arguments ($1, $2, ... ) and have if statements for different cases. The different cases are:
1-argument --> pid
2-arguments --> (-g pid, pid -g, -n name, name -n, -gn name, -ng name, name -gn, name -ng)
3-arguments --> (name -n -g, name -g -n, ...)

but this clearly isn't the right way to do it.
Here is the usage variable btw:

USAGE='Usage: KillByName.sh [-g] -n <name> or KillByName [-g] <pid>'
Help me get some ideas-1png
Help me get some ideas-2png
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Any Ideas?

I have several staging directories on my UNIX server. /usr2/data1 /usr2/data2 /usr2/data3 /usr2/data4 /usr2/data5 /usr2/data6 In these directories a file is transferred from different PC's connected to the network via TCP/IP. The File name is constant for all directories. Transfers... (1 Reply)
Discussion started by: Docboyeee
1 Replies

2. Cybersecurity

Any Ideas !!!!!!!!!!

Hi, I installed sybase server on a LINUX server. I assigen port 2025 whilst installation for sybase , later i uninstalled sybase and when i try to reinstall sybase and use port 2025 it throw up error saying that it is already in use, use other port number. How can I re-use the same port number... (2 Replies)
Discussion started by: suda
2 Replies

3. Shell Programming and Scripting

any ideas?

i need to compare to dates/times given in the format MMDDhhmmYY. That is month, day, hour, minute, year. It is a 24 hour clock. I need to compare two dates to check that they are, say, less than 900 seconds apart. I have got to a point where it checks the time, turns the values into seconds and... (5 Replies)
Discussion started by: fwabbly
5 Replies

4. Shell Programming and Scripting

Scripting ideas?

Hi All, How can I script the following logic? Step 1: Check if the file xyz.txt exists under direcotry test and if the size of the file xyz.txt is greater than 32MB. Step 2: If the above conditions are true(file exists and size >32 MB), then step 3, otherwise step 4 (file does not exist or... (2 Replies)
Discussion started by: Sueyoung88
2 Replies

5. Solaris

Need ideas what is wrong with v440

Hello everyone, I'm here today looking for help... I have a SunFire v440 running Solaris 9 at work that manages the SCSI tape drives(LTO3) in our L700 tape library (runs SAMFS). I went into work today and found the machine was ping-able but I could not connect to it via SSH and could not... (7 Replies)
Discussion started by: mainegeek
7 Replies

6. UNIX for Advanced & Expert Users

Sendmail - Any Ideas?

I have solaris 9 and am using sendmail to pickup requests and forward them to a bulk mail server on a different port. Now for the fun...In sendmail, I need to find a way to place a default address in the Mail From: and Rcpt To: or remove them as required - These will be picked up by the bulk mail... (3 Replies)
Discussion started by: mikey2003ma
3 Replies

7. UNIX and Linux Applications

Need ideas for graduation project based on unix or linux Need ideas for graduation project based on

Dear all, i am in last year of electronics department in engineering faculty i need suggestions for a graduation project based on unix or free bsd or linux and electronics "embedded linux " i think about embedded unix for example or device drivers please i need helps (1 Reply)
Discussion started by: MOHA-1
1 Replies

8. Shell Programming and Scripting

Ideas for while loop

idealy, i'd like to do something like this: while read line do echo $line done < $(egrep error /var/log/syslog) but when i do, i get an unexpected response. i.e. cat test: #!/bin/sh while read line do echo $line done < $(egrep error /var/log/syslog) (12 Replies)
Discussion started by: SkySmart
12 Replies
rtprio(1)						      General Commands Manual							 rtprio(1)

NAME
rtprio - execute process with real-time priority SYNOPSIS
priority command [arguments] priority command [arguments] DESCRIPTION
executes command with a real-time priority, or changes the real-time priority of currently executing process pid. Real-time priorities range from zero (highest) to 127 (lowest). Real-time processes are not subject to priority degradation, and are all of greater (schedul- ing) importance than non-real-time processes. See rtprio(2) for more details. If is specified instead of a real-time priority, executes command with a timeshare (non-real-time) priority, or changes the currently exe- cuting process pid from a possibly real-time priority to a timeshare priority. The former is useful to spawn a timeshare priority command from a real-time priority shell. If is not specified, command is not scheduled, or pid's real-time priority is not changed, if the user is not a member of a group having access and is not the user with appropriate privileges. When changing the real-time priority of a currently executing process, the effec- tive user ID of the calling process must be the user with appropriate privileges, or the real or effective user ID must match the real or saved user ID of the process to be modified. RETURN VALUE
returns exit status 0 if command is successfully scheduled or if pid's real-time priority is successfully changed, 1 if command is not exe- cutable or pid does not exist, and 2 if command (pid) lacks real-time capability, or the invoker's effective user ID is not a user who has appropriate privileges, or the real or effective user or the real or effective user ID does not match the real or saved user ID of the process being changed. EXAMPLES
Execute file at a real-time priority of 100: Set the currently running process pid 24217 to a real-time priority of 40: AUTHOR
was developed by HP. SEE ALSO
setprivgrp(1M), getprivgrp(2), rtprio(2). rtprio(1)
All times are GMT -4. The time now is 04:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy