10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Everyone,
Is there a way I can print specific lines using sed -n '3,3p' file.dat or awk 'FNR==3' file.dat when using variable?
For example, I have this script (get_line.ksh) that accepts line parameter that a user wanted to print in the file.dat.
file.dat
one
two
three
four
... (1 Reply)
Discussion started by: zzavilz
1 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
Greetings. I am facing some troubles and hope that the professionals here could help me.
I am handling a large dataset, and part of it is like below:
1 ab139 0 752566 G A
1 ab151 0 846808 T C
1 ab142 0 854250 G A
1 ab061 0 861808 A G
1 ab043 0 873558 T G... (4 Replies)
Discussion started by: Amanda Low
4 Replies
3. Shell Programming and Scripting
Hi
I have a text like this
example.input
1 red
2 blue
3 green
If I set this
c=2
Then try
awk 'NR==$c { print $2 }' example.input
I do get nothing
If I try
awk 'NR==2 { print $2 }' example.input
i get
blue (8 Replies)
Discussion started by: Jotne
8 Replies
4. Shell Programming and Scripting
Say the input was as follows:
Brat 20 x 1000 32rf
Pour 15 p 1621 05pr
Dart 10 z 1111 22xx
My program prompts for an input, what I want is to use the input to locate a specific field. Like if I type in, "Pou" then it would return "Pour" and just "Pour"
I currently have this line but it is... (6 Replies)
Discussion started by: Bungkai
6 Replies
5. Shell Programming and Scripting
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies
6. Shell Programming and Scripting
using sed to replace a specific string on a specific line number using variables
this is where i am at
grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean
grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies
7. UNIX for Dummies Questions & Answers
Hello sir,
I am using "gpg" command to encrypt a file.
We generally do it :-
then it asks us for :-
I want to know how to give this Passphrase in the command line itself !!!I did read the man page but couldnt make out what is the option for it.Can u please help me out !!! (2 Replies)
Discussion started by: nsharath
2 Replies
8. Shell Programming and Scripting
Hi All,
Although its a basic question the last 2 hours of googling and trying didnt help me to achieve what i want. Maybe some one can help me
I have a text file
text1.txt:
blablablabla
A B C
D E F
and i would like to read to read what is on position E (line 3 column 2) in a... (2 Replies)
Discussion started by: Radamez
2 Replies
9. Solaris
dear all
does any one give any user write permission using access control list or another way to solve this problem (1 Reply)
Discussion started by: murad.jaber
1 Replies
10. Shell Programming and Scripting
hi all...
I am executing a comman in a shell script but the command needs a user input of character 'y' as input so it stops in between...may i know is there is any way of giving that character as input in the shell script itself???...thanks in advance.... (6 Replies)
Discussion started by: santy
6 Replies