script that answers y unless output has a string "STRING" in it
Hi all,
I have the following script which I use to chek the output of jobs submitted to a PBS server.
Since it needs to be fed with the job id name, and since I have 100s of these failed jobs, I made another script (I am not good at scripting yet) I made this other script:
where jobs.txt has all the job ids.
Now this is like a semi-automatic script, so to speak, because I have to answer these questions manually through the keyboard.
Most of the time the answer is yes, unless that output of the second check
contains the string "NO FILES TO RECOVER" in this case it should be given a return (enter hit) so that it aborts the current JOBID and falls to the next JOBID in the jobs.txt (which has all the jobs names one jobs id per line)
How may I achieve an automatic yes unless the output contains NO FILES TO RECOVER?
hello,
i have an statement which i have to correct because it shows the wrong result.
i want to search an excat string in another string, command "grep" shows the wrong result:
example:
STRINGS="string1 string2 string3"
search_string="string"
incorrect:
if
then
echo "not... (0 Replies)
Hello,
I need assistance with creating a shell script to generate SSL Certificate Requests on remote hosts. Below is my stab at this, but I cannot figure out how to pass the requested arguments into the openssl command correctly. I have a major problem with redirecting the "answers" into the... (2 Replies)
Hi,
I have a log file, where i am required to identify the line number, where a particular string/line appears in the log file.
And then copy 200 lines above that line number to a new file.
Can someone provide pointers on how to write this script or what command to be used ?
Any... (2 Replies)
Hi,
I am trying to search a string from a text file which is in between "" (Double Quotes) (Eg: "Unix"), and replace it with a | where ever it is appearing in the text file and save the file.
Please help me.
-kkmdv (6 Replies)
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here.
I have following script (called out_to_streams.csh):
#!/bin/tcsh -f
echo Redirected to STDOUT > /dev/stdout
echo Redirected to... (2 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies
LEARN ABOUT MINIX
projdel
projdel(1M) System Administration Commands projdel(1M)NAME
projdel - delete a project from the system
SYNOPSIS
projdel [-f filename] project
DESCRIPTION
The projdel utility deletes a project from the system and makes the appropriate changes to the system file.
OPTIONS
The following options are supported:
-f filename Specify the project file to modify. If no filename is specified, the system project file, /etc/project, is modified.
OPERANDS
The following operands are supported:
project The name of the project to be deleted.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
2 The command syntax was invalid. A usage message for projdel is displayed.
3 An invalid argument was provided to an option.
4 The projid given with the -p option is already in use.
5 The project files contain an error. See project(4).
6 The project to be modified, group, user, or resource does not exist.
9 The project is already in use.
10 Cannot update the /etc/project file.
FILES
/etc/project System project file
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
|Interface stabilty | See below. |
+-----------------------------+-----------------------------+
Invocation is evolving. Human readable output is unstable.
SEE ALSO projects(1), groupadd(1M), groupdel(1M), groupmod(1M), grpck(1M), logins(1M), projadd(1M), projmod(1M), useradd(1M), userdel(1M), user-
mod(1M), project(4), attributes(5)DIAGNOSTICS
In case of an error, projdel prints an error message and exits with a non-zero status.
NOTES
projdel deletes a project definition only on the local system. If a network name service such as NIS or LDAP is being used to supplement
the local /etc/project file with additional entries, projdel cannot change information supplied by the network name service.
SunOS 5.10 4 May 2004 projdel(1M)