Search Results

Search: Posts Made By: petebear
3,918
Posted By petebear
Asterisk / SIP Question.
I've asked this question on many other forums and no one seems to know, so that's why I posted in the experts forume. So I just got a new sip phone. It is connected via usb to box A in my bedroom....
2,669
Posted By petebear
You can try something like this: awk 'BEGIN...
You can try something like this:

awk 'BEGIN {FS="[, /]"} {gsub (/"/, "")} {FS="/" ; print $6"/"$5"/"$4}' file
Forum: BSD 03-15-2007
2,439
Posted By petebear
Locked Out While Upgrading SSL (Netbsd)
I was attempting to upgrade SSL on my netbsd machine and after a 'make install' I was logged out(I was logged in via ssh), and when I attempted to log back in(via ssh) I was given this message:...
2,884
Posted By petebear
Thank you.
Thank you.
2,884
Posted By petebear
Yes you're correct, sorry I must've pasted the...
Yes you're correct, sorry I must've pasted the first bit of text after I removed the excess whitespace with sed. Anyway, would you mind explaining your solution.
2,884
Posted By petebear
It does get it all on one line, but results look...
It does get it all on one line, but results look like this:

1600-1700 NA U. S. A. WYFR 11565, 11830, 13695,, 17760...
2,884
Posted By petebear
They're shortwave radio broadcasts. They...
They're shortwave radio broadcasts.

They should look something like this:

UTC Time Notes Country Station Frequencies
0000-0015 Am, Su U. S. A. WRMI ...
2,884
Posted By petebear
Sed or Awk Question
I have some text:


0400-0427 NA Czech Republic R. Prague 5990ca, 6200, 7345
0400-0456 NA, As Romania R. Romania Int'l 6115, 9515, 9690,
11895
0400-0500 NA ...
Forum: Programming 11-01-2006
10,230
Posted By petebear
Thank you for the replies. I believe I've got it...
Thank you for the replies. I believe I've got it now.
Forum: Programming 11-01-2006
10,230
Posted By petebear
Hrm, I'm not quite sure I understand. If I just...
Hrm, I'm not quite sure I understand. If I just put the value returned from st_mode(33152)through like this:

%04o\n", statbuf.st_mode

I get 100600. If it's not too much trouble could you...
Forum: Programming 11-01-2006
10,230
Posted By petebear
C File Permission Conversion
I'm new to C, and I'm attempting to write a script similar to the stat command for practice. I only had a problem converting st_mode to an octal permission format. I remembered I had littleutils...
1,611
Posted By petebear
You're welcome.
You're welcome.
1,654
Posted By petebear
Try this: sed "s/=.*/=$(date...
Try this:

sed "s/=.*/=$(date +%F)/g"
1,611
Posted By petebear
Assumeing your new password file is formated with...
Assumeing your new password file is formated with one password per line, something like this could work:


#!/bin/bash -
#

i=1
lines=$(cat passfile | wc -l)

while [ $i -le $lines ]...
3,485
Posted By petebear
Is the sound card in use?
I'm just wondering if there's a simple way (that could be used in a shell script) to tell if the sound card is in use (as in audio is being played)?
12,125
Posted By petebear
I'm sure someone will be able to get your desired...
I'm sure someone will be able to get your desired output into a single field, but here it is in two:

awk 'BEGIN { RS = "/^~/" ; FS = "\n" ; OFS = "~" } {gsub(/ +/, "") ; print $1,$2 }'
13,407
Posted By petebear
Could someone explain this? I understand that...
Could someone explain this? I understand that "/^[^ ]/ " grabs all the usernames. and I think I understand the ternary operator; found equals true (1) if name (the username) is found in $1, or found...
13,407
Posted By petebear
Could someone explain this? I understand that...
Could someone explain this? I understand that "/^[^ ]/ " grabs all the usernames. and I think I understand the ternary operator; found equals true (1) if name (the username) is found in $1, or found...
3,970
Posted By petebear
Well, either of the two commands I gave will will...
Well, either of the two commands I gave will will work on the entire file. I don't see any reason why you'd need a loop just to print your chosen field.
3,970
Posted By petebear
Lots of ways: awk -F":" '{print $1}' file ...
Lots of ways:

awk -F":" '{print $1}' file

cut -d':' -f1 file

Just pick the field you'd like to print ( i.e. $1, $2, or -f1 -f2).
2,192
Posted By petebear
You're welcome.
You're welcome.
2,192
Posted By petebear
This seems to work: #!/bin/bash - ...
This seems to work:


#!/bin/bash -

if [ $# -lt 1 ]; then
echo "Usage: `basename $0` <user>"
exit
fi

USER=$1
LOGINS=`who | grep $USER | wc -l`
TIMES=`who | awk '{print...
22,215
Posted By petebear
With bash version 3.0 or higher you can use ...
With bash version 3.0 or higher you can use
${BASH_ARGV[0]}

This little explanation is of courtesy Dark_Helmet over at linxquestions.org
Showing results 1 to 23 of 23

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