hi,
I have a variable var1 as follows in the script.
var1="one two three desformat=PDF xyz"
I would like to check whether $var1 has a string "desformat=PDF" or not.
Is there any command I can use (not need to creat a file)?
Currently, I am using this:
if ( grep "desformat=PDF"... (1 Reply)
Hi I want to implement the nice command in the shell that I am building. I came to know that there is a corresponding nice() system call for the same. But since I will be forking different processes to run different commands typed on the command prompt, is there any way I can make a command... (2 Replies)
Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
how can i check whether variable contains only character from a-z or A-Z....if my variable contains any alpha numeric, numeric or any character with some special one i.e. *%&@! etcetera etcetera....then it should show me please enter only characters......
Let my variable
var1="abc77}|"
then... (9 Replies)
Hi,
how to check the given string is numeric or not , without converting ( using strtol...).
for ex: if string is C01 - non-numeric data
if string is 001 - numeric data
TIA (11 Replies)
I want to search a file to check if there is string a before string b:
string a, b might not necessarily be in the file, and to return a boolean
string a
(any text)
string b
i have tried for an hour to do this with perl, grep, etc. but no luck
grep doesnt search for patterns... (7 Replies)
I want to check if the string is WINDOWS-1251 or UTF-8
can you help me to find the string encoding???
or maybe to get URL Content-Type charset with wget?
this is my function on PHP
function check_utf8($str) {
$len = strlen($str);
for($i = 0; $i < $len; $i++){
$c =... (2 Replies)
I want to append file with a string but before doing that i want to check if this string already exist in that file.I tried with grep on Solaris 10 but unsuccessful.Man pages from grep seems to suggest if the string is found command status will be 0 and if not 1.But i am not finding it.May be i... (2 Replies)
Hello
So i have that script collection, in which i have a single script to create a configuration file.
In there, i have multiple occourences of something like this:
prj_title=$(tui-read "What is the TITLE? ($prj_name):")
] && prj_title="${prj_name/_/ }"
They all work as expected, if... (5 Replies)
Discussion started by: sea
5 Replies
LEARN ABOUT REDHAT
nice
NICE(2) Linux Programmer's Manual NICE(2)NAME
nice - change process priority
SYNOPSIS
#include <unistd.h>
int nice(int inc);
DESCRIPTION
nice adds inc to the nice value for the calling pid. (A large nice value means a low priority.) Only the superuser may specify a negative
increment, or priority increase.
RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately.
ERRORS
EPERM A non-super user attempts to do a priority increase by supplying a negative inc.
CONFORMING TO
SVr4, SVID EXT, AT&T, X/OPEN, BSD 4.3. However, the Linux and glibc (earlier than glibc 2.2.4) return value is nonstandard, see below.
SVr4 documents an additional EINVAL error code.
NOTES
Note that the routine is documented in SUSv2 to return the new nice value, while the Linux syscall and (g)libc (earlier than glibc 2.2.4)
routines return 0 on success. The new nice value can be found using getpriority(2). Note that an implementation in which nice returns the
new nice value can legitimately return -1. To reliably detect an error, set errno to 0 before the call, and check its value when nice
returns -1.
SEE ALSO nice(1), getpriority(2), setpriority(2), fork(2), renice(8)Linux 2001-06-04 NICE(2)