Unix/Linux Go Back    

Showing results 1 to 20 of 20
Search took 0.01 seconds.
Search: Posts Made By: hexram
Forum: Shell Programming and Scripting Linux 12-20-2012
Replies: 5
Views: 9,049
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...
Forum: Shell Programming and Scripting Linux 12-20-2012
Replies: 10
Views: 12,850
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
Forum: Shell Programming and Scripting Linux 10-26-2012
Replies: 1
Views: 773
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....
Forum: Shell Programming and Scripting Linux 10-15-2012
Replies: 3
Views: 687
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...
Forum: UNIX for Dummies Questions & Answers Linux 10-11-2012
Replies: 11
Views: 1,275
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...
Forum: Shell Programming and Scripting Linux 09-14-2012
Replies: 7
Views: 2,578
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...
Forum: Shell Programming and Scripting Linux 09-12-2012
Replies: 7
Views: 2,578
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...
Forum: Shell Programming and Scripting Linux 09-12-2012
Replies: 2
Views: 890
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? Linux 06-03-2012
Replies: 10
Views: 3,673
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!
Forum: UNIX for Dummies Questions & Answers Linux 06-02-2012
Replies: 4
Views: 1,089
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,...
Forum: Shell Programming and Scripting Linux 05-09-2012
Replies: 18
Views: 1,608
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"...
Forum: UNIX for Dummies Questions & Answers Linux 05-08-2012
Replies: 1
Views: 911
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.
Forum: Shell Programming and Scripting Linux 05-05-2012
Replies: 6
Views: 1,712
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...
Forum: Shell Programming and Scripting Linux 03-22-2011
Replies: 24
Views: 2,646
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...
Forum: UNIX for Advanced & Expert Users Linux 03-16-2011
Replies: 4
Views: 8,543
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...
Forum: Shell Programming and Scripting Linux 02-04-2011
Replies: 3
Views: 1,994
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...
Forum: Shell Programming and Scripting Linux 11-04-2009
Replies: 7
Views: 5,271
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:
...
Forum: UNIX for Advanced & Expert Users Linux 10-19-2009
Replies: 4
Views: 2,540
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...
Forum: Shell Programming and Scripting Linux 01-08-2009
Replies: 9
Views: 2,059
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...
Forum: UNIX for Dummies Questions & Answers Linux 01-28-2008
Replies: 4
Views: 1,295
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 20 of 20

 


All times are GMT -4. The time now is 01:42 AM.