Problem creating file with awk


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem creating file with awk
# 8  
Old 11-25-2010
On what system are you running this?
# 9  
Old 11-26-2010
HP-UX
# 10  
Old 11-26-2010
I don't know much about HP-UX. Maybe you can try using "nawk" instead of "awk" (I don't know if it is available there though).
# 11  
Old 11-26-2010
Hi,

Nawk is not functioning on HP-UX. And now I don't know what to do to have the result of my script in an external file... Smilie
# 12  
Old 11-26-2010
nawk is for solaris
# 13  
Old 11-26-2010
Yes,

I cannot find a solution to get the result in an external file using
Code:
file1 > file2

on HP... Smilie
# 14  
Old 11-26-2010
I still think it is related to the curly brackets that cannot be used. awk on HPUX should work fine.

Are you really sure you tried [0-9][0-9] instead of [0-9]{2} like Bartus suggested? Are your single quotes OK?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating new users using a text file as imput (using only shell script and/or awk)

I need somebody who could help with an exercise. You have a text file called users.txt with this info inside: users.txt: user1:1234:/home/homedir1 ; user2:1234:/home/homedir2 ; user3:1234:/home/homedir3 ; user4:1234:/home/homedir4 ; The script should create an user using the... (2 Replies)
Discussion started by: marcosruiz
2 Replies

2. Shell Programming and Scripting

Creating your own Header file in awk

whether it is possible in awk to create your own header file like in C if so someone give me awk equivalent for below one $ cat foo.h int add(int a,int b) { return(a+b); } $ cat main.c #include<stdio.h> #include"foo.h" void main() { int number1=10,number2=10,number3; number3 =... (5 Replies)
Discussion started by: Akshay Hegde
5 Replies

3. UNIX for Dummies Questions & Answers

Problem in creating CSV file

Hi guys, I am not experienced with Unix, so please dont mind if the question seem to be irrelevant. I have written a simple script, that connects DB & fetches few records from a table. I wanted to get those details as file in .CSV format via mail. -I stored the query o/p in a file. -I... (6 Replies)
Discussion started by: sumitburnwal88
6 Replies

4. Shell Programming and Scripting

problem in creating execute profile file in unix

first i created a profile file(my_var.profile) which contains export my_var=20 after that i created shell scripts(my_var.sh) which contains #!/bin/bash . ./my_var.profile echo '$my_var='$my_var but when i am executing sh my_var.sh it is showing error that no such file/directory .profile.... (6 Replies)
Discussion started by: pratikjain998
6 Replies

5. Shell Programming and Scripting

problem in creating my own profile file in unix

I am new in shell scripting. currently i am using cygwin. My problem is i created a profile file in my own folder. file name is first.profile in which i gave following values to variable export a=10 now i am executing this profile file by below command ./.first.profile it executed... (4 Replies)
Discussion started by: pratikjain998
4 Replies

6. UNIX for Advanced & Expert Users

problem creating pxelinux.cfg default file

Hi All, I was trying to create pxelinux.cfg/default file in a script that I use for creating backup of bootimage. cat 2>${BACKUB_BOOTIMAGE_ERRINFO} >${pxelinux_cfg_file} <<EOF prompt 1 timeout 0 display boot.msg label restore kernel kernel append root=/dev/nfs... (0 Replies)
Discussion started by: Pkumar Sachin
0 Replies

7. Shell Programming and Scripting

Awk print to file problem

Hello, I have a file seperated with "|" I want to search the 11th field if it matches certain words change it to an empty space. I have managed to do that, but now I need it to replace the file. this is my code: awk 'BEGIN{OFS=FS="|"}$11=="to... (9 Replies)
Discussion started by: TasosARISFC
9 Replies

8. Shell Programming and Scripting

awk: creating a fixed-width single file from 2 different files

I have to create a single file from three files, Please see below for samples: day.txt 20090101 20090102 item.txt 123456789101 12345678910209 1234567891 str.txt 1 12 123 output.txt 20090101123456789101 1 0 2009010112345678910209 12 ... (2 Replies)
Discussion started by: tamahomekarasu
2 Replies

9. Shell Programming and Scripting

Creating an sql statement from a file. Problem with '

Hi, I am trying to create sql statements from a file, but I have a problem with ': This is what I do: cat filex.txt | awk -F: '{print $1,"A","and personnavn like",$5}' | sed -e "s/^/select bruker.brukernavn, person.personnavn from bruker, person where brukernavn like '/" -e "s/$/' and... (2 Replies)
Discussion started by: hannem
2 Replies

10. Shell Programming and Scripting

creating a csv file in awk

Hi All I am trying to create a csv file in the korn shell and the script segment is as follows: if then # NEED TO ADD INFO TO THE EMAIL FILE ABOUT THE DRIVE THAT'S FILLING UP echo "$drive $percent% $space "|\ awk '{printf("%d/t"|"%d/t"|"%d/t\n",... (6 Replies)
Discussion started by: Segwar
6 Replies
Login or Register to Ask a Question