Sponsored Content
Full Discussion: Help with the awk syntax
Top Forums Shell Programming and Scripting Help with the awk syntax Post 302817823 by juzz4fun on Thursday 6th of June 2013 01:57:22 PM
Old 06-06-2013
That certainly worked.
But the o/p is like 1st fields on 1st line, 2nd field on 2nd line, 3rd is on 3rd line so on..
how can I avoid this?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with Awk Syntax

I have written many awk commands which go in multiple lines. I have this confusion many times. Some time they work if i dont terminate them with "\" but some time error. Some time in "if" statements between if and else if i dont use ";" it gives error but sometimes it doesnt. The below... (4 Replies)
Discussion started by: pinnacle
4 Replies

2. Shell Programming and Scripting

awk syntax help

I don't get correct output when I run this command line: nmap -sP failedhost.com | grep -i failed | awk -F '{print $6}' I basically want it to return 'failedhost.com' but its just showing the output of the nmap scan. (8 Replies)
Discussion started by: streetfighter2
8 Replies

3. Shell Programming and Scripting

AWK syntax

Hi I am trying to understand AWK syntax so I tried this command which gives me the home directory of root awk 'BEGIN { FS = ":"} {if ($1 == "root") print $6 }' /etc/passwd I would know what are the following commands doing. The first one prints all /etc/passwd, second prints nothing. ... (4 Replies)
Discussion started by: wakatana
4 Replies

4. UNIX for Dummies Questions & Answers

awk syntax

Little bit confusing while using awk :confused::confused: In Sed while pattern search we can use "(double quotes) i mean $a=hello $cat file.txt |sed -n "/$a/p"this thing work fine But if i use it in awk it's not working How could i do the substitution of pattern by a variables and the... (1 Reply)
Discussion started by: posix
1 Replies

5. Shell Programming and Scripting

AWK syntax help

i have a ksh code that needs to be written in AWK. can someone please help me here? :( if }" | grep -c "$2") -gt 0 ] ; then print - "found $2 in array ignore" else print - "did not find $2 in array ignore" fi ignore=4ty56r ignore=er45ty . . . ignore=frhtg2 (27 Replies)
Discussion started by: usustarr
27 Replies

6. AIX

Help with syntax using AWK

I have a file which is comma separated and has quotes. I can use this command and awk -F"," '{ if ($4=="01" print $0 }' test.txt But this doesn't fetch me the data.since it has quotes. If the data has no quotes,the above command works fine. In Unix you can skip quote \" but this doesn't work.... (7 Replies)
Discussion started by: ganesnar
7 Replies

7. Shell Programming and Scripting

awk syntax

Hi I have a bash file which will split a big file to many small files. But I got a syntax error.H="$(head -1 CCC.tped)" awk 'print $0 > $1 ".tped"' CCC.tped for f in $(ls *.tped); do echo "$H\n" "$(cat $f)" >$f; done And -bash-4.1$ bash split awk: print $0 > $1".tped" awk: ^ syntax error... (3 Replies)
Discussion started by: zhshqzyc
3 Replies

8. Shell Programming and Scripting

AWK Function syntax

Hi, I would like to know what is the correct syntax to perform a function in awk. Although I have seen several examples, not get it to work, this is what I'm trying: #!/bin/bash awk function multi (number) { return number * 3 } print multi (4)Thanks (2 Replies)
Discussion started by: Godie
2 Replies

9. Shell Programming and Scripting

Syntax Problem with awk

Hello, I have perl script,which take some part of data in the file. the below command works fine in normal cmd prompt. `awk '/CDI/ && // && !/Result for/ {print $3 $5 > "final.txt"}' datalist.txt`; `nawk -F"" '{print $2}' finalcdi.txt`; But not working. Please use code tags, thanks. (5 Replies)
Discussion started by: rasingraj
5 Replies

10. Shell Programming and Scripting

Awk: syntax error

awk -F, ' NR>1 { BEGIN{ chr=$2 } END{ for (k in chr) {print k} } } ' $gene_file I've a really simple code. I want to store gene name and it's chromosome and in the end print them. I'm skipping line one as it contains headers. But I don't know why I get error as: (2 Replies)
Discussion started by: genome
2 Replies
jfs_mkfs(8)						     JFS file system creation						       jfs_mkfs(8)

NAME
jfs_mkfs - create a JFS formatted partition SYNOPSIS
jfs_mkfs [options] device [ blocks ] DESCRIPTION
jfs_mkfs is used to create (format) a JFS partition. jfs_mkfs must be run as root. device is the special file name corresponding to the actual device (e.g. /dev/hdb1) on which a JFS file system and/or JFS journal will be created. blocks is the number of blocks to be used for the file system. If omitted, jfs_mkfs automatically figures the file system size. The default block size is 4096. WARNING
jfs_mkfs will destroy all data on the specified device! OPTIONS
-c Check the device for bad blocks before building the file system. -j journal_device Create the external JFS journal on journal_device , create the JFS file system on device , and attach the external journal to the file system. -J journal-options Create the JFS journal on its own device or attach an external JFS journal to the JFS file system using options specified on the command-line. The following journal options are supported: journal_dev Create an external JFS journal on the given device. device=external-journal Attach an existing external JFS journal located on external-journal to the JFS file system that will be created on device. The external journal must already have been created using the command jfs_mkfs -J journal_dev external-journal Attach the external journal to the file system being created by using the command jfs_mkfs -J device=external-journal device Instead of specifying a device name directly, external-journal can also be specified by either LABEL=label or UUID=UUID to locate the external journal by either the volume label or UUID stored in the JFS external log superblock at the start of the journal. Use jfs_tune(8) to display a journal device's volume label and UUID. (See the -l, -L, and -U options of jfs_tune(8).) Only one of the journal_dev or device= options can be given per jfs_mkfs issuance. -L volume_label Set the volume label for the newly formatted device. If -L volume_label is used along with -J journal_device, the volume label of the specified external journal device will be set to volume_label. Otherwise, the volume label of the JFS file system will be set to volume_label. -O Provide case-insensitive support for compatibility with OS/2. -q Quiet execution - do not ask for confirmation before creating the file system. -s log_size Set the log size (in megabytes) of the inline log. If the -s option is not used, the default log size is 0.4% of the aggregate size. -V Print version information and exit (regardless of any other chosen options). EXAMPLES
Format 3rd partition on 2nd hard disk with the volume label "JFS_hdb3": jfs_mkfs -L JFS_hdb3 /dev/hdb3 Format 5th partition on 1st hard disk, verifying each block created: jfs_mkfs -c /dev/hda5 Format 3rd partition on 2nd hard disk as external journal, format 4th partition on 1st hard disk as JFS file system, and attach the exter- nal journal to the file system: jfs_mkfs -j /dev/hdb3 /dev/hda4 REPORTING BUGS
If you find a bug in JFS or jfs_mkfs, please report it via the bug tracking system ("Report Bugs" section) of the JFS project web site: http://jfs.sourceforge.net/ Please send as much pertinent information as possible including any error messages resulting from running jfs_mkfs. SEE ALSO
mkfs(8), jfs_fsck(8), jfs_fscklog(8), jfs_tune(8), jfs_logdump(8), jfs_debugfs(8) AUTHORS
Barry Arndt (barndt@us.ibm.com) William Braswell, Jr. jfs_mkfs is maintained by IBM. See the JFS project web site for more details: http://jfs.sourceforge.net/ March 9, 2005 jfs_mkfs(8)
All times are GMT -4. The time now is 12:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy