AWK in Putty


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting AWK in Putty
# 1  
Old 07-17-2009
AWK in Putty

I am a beginner with shell script and AWK. I use PUTTY to write shell script.
Can I create new AWK script using vi command? I tried sample.awk. But everytime I open this file, the file does not retain anything I typed in.

Also, once AWK program is written, how do I execute it?

Thanks!
# 2  
Old 07-17-2009
see man pages of awk

you can use any of your fav editor to write script.

if you want complete awk script, you should use "-f" option.

at your prompt, type:

Code:
awk -f myawkscript mytestfile

cat myawkscript
{print $0}

cat mytestfile
Hello World!

awk expects an input file to read.


alternatively, if you want to use awk as a part of your normal shell script,

Code:
## test scipt

echo "Hello World!" > mytestfile
### shell commands
## shell commands
awk '
### awk commands here
 {print $0} ' mytestfile ### awk ends here

### shell commands here

# 3  
Old 07-17-2009
I think you're confused on what software you're using, PUTTY is not a text editor. Whatever its talking to might be running a text editor however.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Regarding PUTTY

Hello Forum members There is no any time parameter on putty so how can I stay my putty ssh session always Alive? So please reply to my querry. I am looking forward from Forum. Advance Thanks Siva. (5 Replies)
Discussion started by: workforsiva
5 Replies

2. Shell Programming and Scripting

Putty / Plink help

Im trying C:\Program Files\PUTTY\plink.exe mysite.net -l username -pw mypassword -m restart.sh But the login / password are never sent. If I remove the -m restart.sh it will login I need the command inside restart.sh issued after the login password is completed. THanks (6 Replies)
Discussion started by: Greystone
6 Replies

3. UNIX for Advanced & Expert Users

Help for PuTTy.

I'm using PuTTY to establish a SSH connection to a remote UNIX machine. I need to fetch a file from the remote system into my local Windows system. Is it possible? If yes, how can I do that? (2 Replies)
Discussion started by: agnivaccent
2 Replies

4. Windows & DOS: Issues & Discussions

Putty disconnects after sometime

i am using Putty to do ssh to all the unix nodes that we have in our work environment. it is very strange that all my network connections will timeout quickly in 10 mins, it can either be a putty connection, sqlplus or toad. is there some setting that can help to prevent this. please let me know... (3 Replies)
Discussion started by: sudhiroracle
3 Replies

5. UNIX for Dummies Questions & Answers

putty script

i was having problem on unix command.here's my script set server_exe="C:\filecopy\putty.exe" %server_exe% sgxaspecs3@sporc01 -pw pit54321 -b c:\filecopy\file_sporc01putfiles2.txt echo "file uploaded to SFTP Server" pause ok the thing is like this, i could login to putty by running this... (1 Reply)
Discussion started by: dannyd_y
1 Replies

6. UNIX for Dummies Questions & Answers

Host Name for PuTTY

im using the PuTTY configuration and i need a host name! something that will give a prompt similar to this: jdoe@theHostName.whatever.net or .com or .org ( im sure your familar ) then i need to login ( hopefully at the website ) and get this upon login: $ i need this.. (1 Reply)
Discussion started by: oxoxo
1 Replies

7. UNIX for Dummies Questions & Answers

putty

i am connecting to a unix-application using putty (xp). sometime, it is as if the putty is sending a form-feed char, because i am getting a blank screen, and by back scrolling i see the previous screen with all the related data. if i am using the xp-telnet, i get the screen/data correctly. ... (7 Replies)
Discussion started by: mifa-system
7 Replies

8. Shell Programming and Scripting

Color putty

Right now I am using putty. I am using 2-3 terminals at a time. To differentiate each termianl I want to put each putty screen and background color to different colors. I tried changing the colors in normal putty but it's not working. Is there any other color putty ? Regards, Venkat (2 Replies)
Discussion started by: svenkatareddy
2 Replies

9. News, Links, Events and Announcements

PuTTY 0.59

On my opinion, one of the best ssh/telnet clients for windows, putty released a new version: Get it here, PuTTY 0.59 - PuTTY can now connect to local serial ports as well as making network connections. - Improved speed of SSH, particularly SSH-2 key exchange and public-key authentication -... (2 Replies)
Discussion started by: pressy
2 Replies

10. Solaris

SSH with Putty

I've been trying to setup my SunBlade as an SSH server. I configured the sshd_config file, but I cannot get the keys to exchange properly. I generate a key pair in Putty on my laptop (the host, running Win2K), exported the Private key as OpenSSH and then copied the public key to the a file I... (3 Replies)
Discussion started by: AJA
3 Replies
Login or Register to Ask a Question