10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am working on a script, which requests users to enter input.
Ex: read -p "Please enter your email id:" email
I don't want users skipping this entry, this has to be mandatory.I dont want to proceed without input.
I can do a check if variable $email is empty and proceed if not.But, i... (7 Replies)
Discussion started by: aravindadla
7 Replies
2. Shell Programming and Scripting
I have a file1.txt with several 100k lines, each of which has a column 9 containing one of 60 "label" identifiers. Using an labels.txt file containing a list of labels, I'd like to extract 200 random lines from file1.txt for each of the labels in index.txt.
Using a contrived mini-example:
$ cat... (8 Replies)
Discussion started by: pathunkathunk
8 Replies
3. Shell Programming and Scripting
Hello All,
Here is my input
univ1 chr1 100 200 - GeneA 500 1 0 0.1 0.2 0.3 0.4 0.5
univ1 chr1 100 200 - GeneA 600 1 0 0.0 0.0 0.0 0.0 0.1
univ1 chr1 100 200 - GeneA 700 1 0 0.4 0.4 ... (2 Replies)
Discussion started by: jacobs.smith
2 Replies
4. Shell Programming and Scripting
Dear Friends,
I am looking for a shell script to merge input files into one file .. here is my idea:
1st paramter would be outfile file (all input files content)
read all input files and merge them to input param 1
ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Discussion started by: hyd1234
4 Replies
5. UNIX for Dummies Questions & Answers
I have a file of protein sequences with headers (my source file). Based on a list of IDs (which are included in some of the headers), I'd like to print out only the specified sequences, with only the ID as header.
In other words, I'd like to search source.txt for the terms in IDs.txt, and print... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
6. UNIX for Dummies Questions & Answers
Hi !
It is a general question.
When an awk script looks like:
#! bin/awk
function example(i){
<body>
}
{
example(1) #the function uses input_1 and return output_a
}
{
example(2) #the function uses previous output_a as an input and returns... (15 Replies)
Discussion started by: beca123456
15 Replies
7. Shell Programming and Scripting
Hi
I am new to writing script and want to use a Bash Piped while-read and read from user input.
if something happens on server.log then do while loop or if something happend on user input then do while loop.
Pseudocode something like:
tail -n 3 -f server.log | while read serverline || read... (8 Replies)
Discussion started by: MyMorris
8 Replies
8. Shell Programming and Scripting
abc.dat
tty cpu
tin tout us sy wt id
0 0 7 3 19 71
extended device statistics
r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device
0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0
0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx
I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies
9. UNIX for Dummies Questions & Answers
Hey everyone,
Basically, all I'm looking for is a way to regex for not a certain string. The regex I'm looking to avoid matching is:
D222
i.e. an equivalent of:
awk '!/D222/'
The problem is that I use this in the following command in a Bash script:
ls ${source_directory} | awk... (1 Reply)
Discussion started by: kdelok
1 Replies
10. Shell Programming and Scripting
Here's the problem...
I have a mysqldump file and I need to put single quotes around the date/time timestamp. So for example I have a line like:
INSERT INTO attachments VALUES (1,182,2004-08-06 09:24:04,'description'...
and I need it to become
INSERT INTO attachments VALUES... (10 Replies)
Discussion started by: primal
10 Replies