9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I am writing a shell script where I want that # should be added in all those lines as the first character where the pattern matches.
file has lot of functions defined
a.sh
#!/bin/bash
fn a {
beautiful evening
sunny day
}
fn b {
}
fn c {
hello world .its a beautiful day
... (12 Replies)
Discussion started by: ashima jain
12 Replies
2. Shell Programming and Scripting
awk 'BEGIN{OFS=","} FNR == 1
{if (NR > 1) {print fn,fnr,nl}
fn=FILENAME; fnr = 1; nl = 0}
{fnr = FNR}
/UNUSUAL/ && /\.gz/ ~ /FILENAME/ {nl++}
<'{system ("gunzip -cd FILENAME")}'
END ... (2 Replies)
Discussion started by: SkySmart
2 Replies
3. Shell Programming and Scripting
Hi Unix Gurus,
yesterday I asked a question and got answer, it works fine.
I have one more thing need to help
in the code
awk '{print substr($0,1,3)"xxx"substr($0,7)}' file
If I have 50 charactor's need to be replaced, is there any easy way to use reg exp or I have to input 50 XXXXx......... (12 Replies)
Discussion started by: ken6503
12 Replies
4. Shell Programming and Scripting
I decided I wanted to have the cd command print my full working directory after each cd command, so I put this cw command in .bashrc as a function.
cw ()
{
cd "${1}"
pwd
}While this works I would like pwd to print escapes when a space in a directory name exists. This would... (7 Replies)
Discussion started by: jelloir
7 Replies
5. Shell Programming and Scripting
Input:
hello
world
monkey
Output should be:
Hello
World
Monkey
How can it be done with perl,sed,awk or bash? (9 Replies)
Discussion started by: cola
9 Replies
6. UNIX for Dummies Questions & Answers
Hi everyone!
first of all thank you all for the forum.
My question is, is there a bash or java program, which addresses the existing text in the html that is visible in the web page for editing by another string, eg
name1: flakjsdlñfjas
Name of father: fdfjaksdfjskdfsd
Well it... (1 Reply)
Discussion started by: xavilito
1 Replies
7. Linux
Hi :)
I have 2 files
file1:
SNP_A-2208459
SNP_A-4215188
SNP_A-2012248
SNP_A-1882998
file2:
CHR SNP UNADJ BONF HOLM * * * etc.
19 SNP_A-2236481 1.742e-26 5.442e-21
13 SNP_A-4204405 8.643e-07 1.505e-06
3 SNP_A-1860908... (11 Replies)
Discussion started by: sogi
11 Replies
8. Shell Programming and Scripting
Hi All ,
I have an output value with two columns like this...
Days User
10 A
500 B
1 C
How i can compare the first column value and passing the user name as parameter?
For example :
while read -r days
If (days<=30) ;
then
value=days/30 x100
... (3 Replies)
Discussion started by: EDBGSK
3 Replies
9. Shell Programming and Scripting
If i have a variable which is a decimal number, i.e 34.05 How can you make decimal point fall on the 15th character on the screen? Or any other that you can specify? Can you do it using sed or awk? (3 Replies)
Discussion started by: Vozx
3 Replies