09-20-2018
I actually had it in quotes but copy pasted the initial code that I ended up adjusting.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Does anyone know of a way to mimic the up arrow/down arrow type bash behavior within a shell script?
Say I have a scripted menu, and would like to be able to up arrow to bring up the last X number of lines of user input?
Thanks to anybody with a suggestion. :) (0 Replies)
Discussion started by: sysera
0 Replies
2. Shell Programming and Scripting
hi,
i have a script that runs on bash and would like to run it on a machine that has csh and bash. the default setting on that machine is csh. i dont want to change my code to run it with a csh shell. is there any way i can run the script (written in bash) on this machine? in other words is there... (3 Replies)
Discussion started by: npatwardhan
3 Replies
3. Shell Programming and Scripting
The block below isn't a surprise:$ ls
file1 file2 file3
$ x=*
$ echo $x
file1 file2 file3
$ echo '$x'
$x
$ echo "$x"
*
$But I found this block a bit bewildering:$ echo $x'
>'
*
$I'm wondering why substitution wasn't performed on the $x, since it was unquoted (as far as I can tell).... (5 Replies)
Discussion started by: na5m
5 Replies
4. Red Hat
Hi all
I am relatively new to linux (specifically red hat). I have installed Fedora 13 on my machine and started playing with the terminal when i found a very strange behavior when typing a command that is not found:
the terminal does not prompt me back. In other words, i am logged as root (or... (4 Replies)
Discussion started by: abohmeed
4 Replies
5. UNIX for Advanced & Expert Users
run_xfs_fsr is a xfs filesystem maintenance script designed to run under cron. The system is a home theater personal computer running mythbuntu 10.10, and is accessed remotely for these tests. cron runs a script, (xfs_fsr.sh) at 02:30 that runs the subject script under BASH and sets the... (3 Replies)
Discussion started by: keepitsimpleeng
3 Replies
6. UNIX for Advanced & Expert Users
I am trying to get my history in sync in multiple bash sections and things aren't working the way I expect.
Desired behavior, hitting esc-K in all bash sessions (same userid and machine) will use the same history.
Observed behavior: Esc-k shows the history of the current session, rather than... (8 Replies)
Discussion started by: gg48gg
8 Replies
7. UNIX for Dummies Questions & Answers
# check host value regex='^(||1|2|25)(\.(||1|2|25)){3}$' if ')" != "" ]; then if ]; then echo host $host not found exit 4 fi elif ]; then echo $host is an invalid host address exit 5 fi
espeacailly the top regex part?
---------- Post updated at 06:58 PM ---------- Previous update was... (1 Reply)
Discussion started by: kevin298
1 Replies
8. UNIX for Advanced & Expert Users
Good Morning
I think there may be something I dont understand fully.
The following code works well, but I dont like the set domen method.
#!/bin/bash
#
domen="y"
while
do
echo " M A I N - M E N U"
echo "1. Contents of /etc/passwd"
echo "2. List of users currently logged"
echo... (10 Replies)
Discussion started by: popeye
10 Replies
9. Shell Programming and Scripting
I'm new to utilities like socat and netcat and I'm not clear if they will do what I need.
I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes.
I'm using Cygwin bash on Windows 10.
My... (3 Replies)
Discussion started by: siegfried
3 Replies
10. UNIX for Beginners Questions & Answers
In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ?
--- Post updated at 08:39 AM ---
in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies
LEARN ABOUT CENTOS
sched_rr_get_interval
SCHED_RR_GET_INTERVAL(2) Linux Programmer's Manual SCHED_RR_GET_INTERVAL(2)
NAME
sched_rr_get_interval - get the SCHED_RR interval for the named process
SYNOPSIS
#include <sched.h>
int sched_rr_get_interval(pid_t pid, struct timespec * tp);
DESCRIPTION
sched_rr_get_interval() writes into the timespec structure pointed to by tp the round-robin time quantum for the process identified by pid.
The specified process should be running under the SCHED_RR scheduling policy.
The timespec structure has the following form:
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
If pid is zero, the time quantum for the calling process is written into *tp.
RETURN VALUE
On success, sched_rr_get_interval() returns 0. On error, -1 is returned, and errno is set appropriately.
ERRORS
EFAULT Problem with copying information to user space.
EINVAL Invalid pid.
ENOSYS The system call is not yet implemented (only on rather old kernels).
ESRCH Could not find a process with the ID pid.
CONFORMING TO
POSIX.1-2001.
NOTES
POSIX systems on which sched_rr_get_interval() is available define _POSIX_PRIORITY_SCHEDULING in <unistd.h>.
Linux notes
POSIX does not specify any mechanism for controlling the size of the round-robin time quantum. Older Linux kernels provide a (nonportable)
method of doing this. The quantum can be controlled by adjusting the process's nice value (see setpriority(2)). Assigning a negative
(i.e., high) nice value results in a longer quantum; assigning a positive (i.e., low) nice value results in a shorter quantum. The default
quantum is 0.1 seconds; the degree to which changing the nice value affects the quantum has varied somewhat across kernel versions. This
method of adjusting the quantum was removed starting with Linux 2.6.24.
Linux 3.9 added a new mechanism for adjusting (and viewing) the SCHED_RR quantum: the /proc/sys/kernel/sched_rr_timeslice_ms file exposes
the quantum as a millisecond value, whose default is 100. Writing 0 to this file resets the quantum to the default value.
SEE ALSO
sched_setscheduler(2) has a description of the Linux scheduling scheme.
Programming for the real world - POSIX.4 by Bill O. Gallmeister, O'Reilly & Associates, Inc., ISBN 1-56592-074-0.
COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2013-03-18 SCHED_RR_GET_INTERVAL(2)