Search Results

Search: Posts Made By: hexram
3,250
Posted By hexram
My idea would be to condition the assignment of...
My idea would be to condition the assignment of an asterisk to $i only when it is a digit, i.e.:
if($i~="[0-9]")$i="*"
Hope it helps
32,350
Posted By hexram
Have you tried using a file editor to create your...
Have you tried using a file editor to create your script? When you use
echo "Whatever you say" >Filename.extension
if there is a double quote INSIDE 'Whatever you say', then you don't get what you...
30,122
Posted By hexram
OK. Here is what I have done: File yes.txt...
OK. Here is what I have done:

File yes.txt (before):
yes
why
when
what

File yes.sh:
#!/bin/sh
sed -i 's/yes/no/' yes.txt
sed -i 's/why/where/' yes.txt
sed -i 's/when/how/' yes.txt
...
1,759
Posted By hexram
Disasters. If you care of the well being of your...
Disasters. If you care of the well being of your system, DO NOT TYPE THIS!!! If you type this, DO NOT PRESS RETURN!!!

Basically what you are doing here is defining a recursive function gone rogue....
1,293
Posted By hexram
Problem is not with sed. Problem is with your...
Problem is not with sed. Problem is with your shell. Variable substitution occurs in the shell and the result is then fed to the command you want to run; so, you need to allow the shell to do...
2,214
Posted By hexram
Maybe it should be: awk 'NR==FNR { A[$1]=$1;...
Maybe it should be:
awk 'NR==FNR { A[$1]=$1; next } $1 in A' file2 file1
^
Missing
Sorry, just read the post and thought "this is the error"; just did not...
4,432
Posted By hexram
I don't follow the logic behind if(skip != 0 ||...
I don't follow the logic behind
if(skip != 0 || $2+0 == day + 2) skip=1

# or
if (skip == 0) {
if ($2+0 == day + 2) skip =1
}
being equivalent... The first statement is "if ((skip is not...
4,432
Posted By hexram
Wow, Chubler_XL, I stand in awe... After thirty...
Wow, Chubler_XL, I stand in awe... After thirty years or so using Unix, Linux, and awk (among others, see, this is my work AND my hobby too), I am completely stupefied at:
skip=skip||$2+0==day+2 and...
1,632
Posted By hexram
This works for LinuxMint (i.e. Ubuntu, i.e....
This works for LinuxMint (i.e. Ubuntu, i.e. Debian, ...):

awk 'BEGIN{ p=1 } { p *= $1 } END{ print p }' input_filename

and personally I find it neater to read...
Forum: What is on Your Mind? 06-03-2012
6,295
Posted By hexram
Liked it and pressed the dreaded button... Great...
Liked it and pressed the dreaded button... Great job!

Neo: 10,000 Bit Transferred... Thanks!
1,694
Posted By hexram
Maybe this can help: egrep ^...a.....n....
Maybe this can help:
egrep ^...a.....n. /usr/share/dict/2of12.txt | head -5
advancement
apparition
arraignment
arrangement
audaciousness

I think that a period matches any character,...
2,950
Posted By hexram
Good news! This is what I get when I do EXACTLY...
Good news! This is what I get when I do EXACTLY as you say you do:
<?xml version="1.0"...
3,319
Posted By hexram
Try this: sed -e "/$record/d" file Note the...
Try this:
sed -e "/$record/d" file
Note the -e option and the DOUBLE quotes replacing the SINGLE quotes.
2,832
Posted By hexram
Program top comes with a manual; you can read the...
Program top comes with a manual; you can read the manual of program top by issuing

man top

after the prompt. In the manual you can find

2b. SELECTING and ORDERING Columns

in which you are...
4,304
Posted By hexram
Sorry. Couldn't find the question. What follows...
Sorry. Couldn't find the question. What follows is just my guess at what you may want:
The processing under the 'default' tag in your switch looks like a pre-processing block that should be done...
11,952
Posted By hexram
From "AIX Version 4.3 Commands Reference, Volume...
From "AIX Version 4.3 Commands Reference, Volume 2" (http://www.ualberta.ca/dept/chemeng/AIX-43/share/man/info/C/a_doc_lib/cmds/aixcmds2/grep.htm):
-p[Separator] Displays the entire paragraph...
2,530
Posted By hexram
Your spec can be described as "Keep printing...
Your spec can be described as "Keep printing lines from the one following the first matched to the last matched". You match the first line that you want, so you get a new line (getline), print it and...
7,152
Posted By hexram
Further to pludi. Even if user insists on...
Further to pludi.

Even if user insists on changing exactly what is being said in sed command, it would not make any difference from what you are replying because the command can be written as:
...
3,108
Posted By hexram
You should use another character as a delimiter...
You should use another character as a delimiter in sed command:
sed -e "s%State%$BC%g" bfile
instead of:
sed -e "s/State/$BC/g" bfile
for example... You may choose a character that is not in the...
2,676
Posted By hexram
sed usage
sed is a stream editor, which means it transforms a flow of input into a flow of output by following a flow of instructions. As I can see from your example, you are not providing input to sed; please...
2,177
Posted By hexram
Maybe this can help... [Chapter 7] 7.3 Saving...
Maybe this can help...
[Chapter 7] 7.3 Saving Commands (http://www.unix.org.ua/orelly/unix/vi/ch07_03.htm)
The general idea is to define an abbreviation or a keyboard sequence as the keystrokes...
Showing results 1 to 21 of 21

 
All times are GMT -4. The time now is 05:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy