03-08-2010
how to create one newfile and wants include some lines based on user request
I have one request, First it has to create one file and in that file
it has to include some lines based on user request.
Suppose user requested 10, then script needs to add 10 lines like below
QAEVO_A1|A1
QAEVO_A2|A2
QAEVO_A3|A3
QAEVO_A4|A4
QAEVO_A5|A5
QAEVO_A6|A6
QAEVO_A7|A7
QAEVO_A8|A8
QAEVO_A9|A9
QAEVO_10|A10
Thanks,
Sri.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to add lines in my script dynamically.
My script:
...
echo addscript
end addscript
...
Lines to add: (can be put in a file and can be added)
cp /opt/script1.sh opt/script1_org.sh
sed 's/testusr/'${FUNCTID}'/g' /opt/script1.sh > ./tmpfile
mv ./tmpfile /opt/script1.sh... (1 Reply)
Discussion started by: chiru_h
1 Replies
2. Homework & Coursework Questions
first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies
3. Programming
Please pardon my ignorance, but I need to create a web-based form which can be used to request access to the unix servers in our environment. It just needs to have input fields for basic info (name, dept., etc.), and perhaps a drop-down box with the names of the servers. The form will be submitted... (2 Replies)
Discussion started by: wjssj
2 Replies
4. Shell Programming and Scripting
Hello. My latest project has me with the need for the following script. Basically, any directory that includes a .jpg file needs to also have a ".picture" file created (if it doesn't exist). Here's an example of what I need.
/mnt/user/Pictures/2011/Hawaii - 2011/.picture... (11 Replies)
Discussion started by: Davinator
11 Replies
5. Shell Programming and Scripting
Hi folks! I'm new to the unix-side of the world! ;) and I'm trying to learn as much as possible the good stuff that's in it!
So.. here comes the point.. as you can see in the title, I need to copy a file but truncating it so that last 1-2 lines are not copied... any suggests from the... (6 Replies)
Discussion started by: WideMind
6 Replies
6. Shell Programming and Scripting
In the below bash a file is downloaded when the program is opened and then that file is searched based on user input and the result is written to a new file.
For example, the bash is opened and the download.txt is downloaded, the user then enters the id (NA04520). The id is used to search... (5 Replies)
Discussion started by: cmccabe
5 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I am a newbie,
I am looking for a script that can capture logs based on a request id and store it in tmp folder
Log files looks like this"
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 Inside test method
- 2015-07-08 10:59:17,100 INFO RequestId -> 923559008 End of... (2 Replies)
Discussion started by: tsingh
2 Replies
8. Shell Programming and Scripting
Hi Friends,
I have a menu based tool which requires input/option to proceed further. How to make a shell script ?
eg: menu looks like
Get_data.sh
to continue (y/n) :
Here I need to key in "y" to proceed.
I want to prepare a script which should consider option y. (5 Replies)
Discussion started by: suresh3566
5 Replies
9. Shell Programming and Scripting
I am trying to create a bash script that will create new function by using the user input. The below will create the necessary files in the correct format, however when it comes to the # create function I am at a loss.
If the name entered was NEWNAME and the genes were GENE1,GENE2 then two files... (0 Replies)
Discussion started by: cmccabe
0 Replies
10. Shell Programming and Scripting
I am trying to use awk to create (in this example) 3 seperate text file from the unique id in $1 in file, if it starts with the pattern aa. The contents of each row is used to populate each text file except for $1 which is not needed. It seems I am close but not quite get there. Thank you :).
... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT MOJAVE
request-key.conf
REQUEST-KEY.CONF(5) Linux Key Management Utilities REQUEST-KEY.CONF(5)
NAME
request-key.conf - Instantiation handler configuration file
DESCRIPTION
This file is used by the /sbin/request-key program to determine which program it should run to instantiate a key.
request-key works scans through the file a line at a time until it finds a match, which it will then use. If it doesn't find a match, it'll
return an error and the kernel will automatically negate the key.
Any blank line or line beginning with a hash mark '#' is considered to be a comment and ignored.
All other lines are assumed to be command lines with a number of white space separated fields:
<op> <type> <description> <callout-info> <prog> <arg1> <arg2> ...
The first four fields are used to match the parameters passed to request-key by the kernel. op is the operation type; currently the only
supported operation is "create".
type, description and callout-info match the three parameters passed to keyctl request2 or the request_key() system call. Each of these may
contain one or more asterisk '*' characters as wildcards anywhere within the string.
Should a match be made, the program specified by <prog> will be exec'd. This must have a fully qualified path name. argv[0] will be set
from the part of the program name that follows the last slash '/' character.
If the program name is prefixed with a pipe bar character '|', then the program will be forked and exec'd attached to three pipes. The
callout information will be piped to it on it's stdin and the intended payload data will be retrieved from its stdout. Anything sent to
stderr will be posted in syslog. If the program exits 0, then /sbin/request-key will attempt to instantiate the key with the data read from
stdout. If it fails in any other way, then request-key will attempt to execute the appropriate 'negate' operation command.
The program arguments can be substituted with various macros. Only complete argument substitution is supported - macro substitutions can't
be embedded. All macros begin with a percent character '%'. An argument beginning with two percent characters will have one of them dis-
carded.
The following macros are supported:
%o Operation type
%k Key ID
%t Key type
%d Key description
%c Callout information
%u Key UID
%g Key GID
%T Requestor's thread keyring
%P Requestor's process keyring
%S Requestor's session keyring
There's another macro substitution too that permits the interpolation of the contents of a key:
%{<type>:<description>}
This performs a lookup for a key of the given type and description on the requestor's keyrings, and if found, substitutes the contents for
the macro. If not found an error will be logged and the key under construction will be negated.
EXAMPLE
A basic file will be installed in the /etc. This will contain two debugging lines that can be used to test the installation:
create user debug:* negate /bin/keyctl negate %k 30 %S
create user debug:loop:* * |/bin/cat
create user debug:* * /usr/share/keyutils/request-key-debug.sh %k %d %c %S
negate * * * /bin/keyctl negate %k 30 %S
This is set up so that something like:
keyctl request2 user debug:xxxx negate
will create a negative user-defined key, something like:
keyctl request2 user debug:yyyy spoon
will create an instantiated user-defined key with "Debug spoon" as the payload, and something like:
keyctl request2 user debug:loop:zzzz abcdefghijkl
will create an instantiated user-defined key with the callout information as the payload.
FILES
/etc/request-key.conf
SEE ALSO
keyctl(1), request-key.conf(5)
Linux 11 July 2005 REQUEST-KEY.CONF(5)