- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: runawk
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 12:43 AM
тАО01-19-2009 12:43 AM
runawk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 12:59 AM
тАО01-19-2009 12:59 AM
Re: runawk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 01:07 AM
тАО01-19-2009 01:07 AM
Re: runawk
you run that program by calling:
$ awk -f program.file data.file
or you modify the first of programm file to:
#/usr/bin/awk
so that program is executed directly by awk.
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 01:20 AM
тАО01-19-2009 01:20 AM
Re: runawk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 01:27 AM
тАО01-19-2009 01:27 AM
Re: runawk
you are free in naming your awk script. Unix does not know something like file name extensions as windows does ( e.g. *.exe ).
i used "program.file" and "data.file" just as placeholder names. Replace them with the filenames you use.
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 01:39 AM
тАО01-19-2009 01:39 AM
Re: runawk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 01:42 AM
тАО01-19-2009 01:42 AM
Re: runawk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 02:00 AM
тАО01-19-2009 02:00 AM
Re: runawk
it was not the best idea to name your program like the interpreter, 'test' would have been a name, I wouldn't recommend as well.
It may help you, using .awk as a suffix, if you are used to identify your home made programs that way.
NB: An awk program gets interpreted - there is no compiling stage.
1) Rename your awk-program named awk
mv awk prog1.awk
2) Check the first line of your program
sed 1q prog1.awk
3) If the output is not like this
#!/usr/bin/awk -f -
add a line with exactly this text.
4) Add the execute-bit to that program
chmod +x prog1.awk
Every awk program read the stdin, when no filename(s) are provided as parameters.
5) So just calling
./prog1.awk
will wait for data entered
6) ./prog1.awk "file-with-data"
will read that file
7) ... | ./prog1.awk
will read data from the pipe (output of the command "...")
mfG Peter
Now it depends, how your awk program works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 02:14 AM
тАО01-19-2009 02:14 AM
Re: runawk
Please refer to http://forums11.itrc.hp.com/service/forums/helptips.do?#28 to understand about the member point system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-19-2009 02:32 AM
тАО01-19-2009 02:32 AM
Re: runawk
I just so the connection to another thread of you:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1302055
Your question and answers direct me to this awk program, which you should save as
file /usr/local/checkid.awk
#!/usr/bin/awk -f -
BEGIN {FS=":"}
{
# print $1, $3, $5
if ($1 == "+") next
if ($5 == "") {
print "No user name for", $1
}
if ($3 == 0) {
print "superuser", $1, $5
if ($1 != "root") {
print "superuser but not root:", $1, $5, "<******"
}
}
Having done then the steps 1-4 of my previous post, execute this commandline under any directory:
/usr/local/checkid.awk /etc/passwd
Additions:
1) There may other naming services (NIS,...) active, but this could be out of the scope you can handle by yourself.
ypcat passwd | /usr/local/checkid.awk
would examine NIS for example.
2) Can it be, that your clients notice was a direction to UIDs used on this system, not having an entry in a passwd database (/etc/passwd; NIS) at all?
For example, a command like
ls -ld "file-uid-only"
would not show a name in the user column but only a number for a file owned by such an UID.
Good luck!
Peter