Sponsored Content
Full Discussion: cut or nawk
Top Forums Shell Programming and Scripting cut or nawk Post 302675543 by elixir_sinari on Monday 23rd of July 2012 09:02:49 AM
Old 07-23-2012
Code:
nawk '/busti/ && match($8,/(\/[^\/]*){5}/) {print substr($8,RSTART,RLENGTH)}' ruta.txt

This User Gave Thanks to elixir_sinari For This Post:
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

2. Shell Programming and Scripting

Nesting - two nawk into one nawk

hi people; this is my two awk code: nawk '/cell+-/{r=(NF==8) ? $4FS$5FS$6 : NF==7 ? $4FS$5 : $4 ;c=split(r,rr);for (i=1;i<=c;i++){if(rr != "111111"){printf($3" %d ""\n",(i+3))}}printf("")}' /home/gc_sw/str.txt > /home/gc_sw/predwn.txt nawk -F'*' '{gsub(/ *$/,"")}$0=$1$($NF-2)'... (2 Replies)
Discussion started by: gc_sw
2 Replies

3. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

4. Shell Programming and Scripting

Nawk Problem - nawk out of space in tostring on

Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies

5. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

6. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies
MKFATIMAGE16(1) 					      Make HDIMAGE for DOSEMU						   MKFATIMAGE16(1)

NAME
mkfatimage16 - generate a virtual drive image suitable for DOSEMU SYNOPSIS
mkfatimage16 [ -b bsectfile ] [{ -t tracks | -k Kbytes }] [ -l volume-label ] [ -f outfile ] [ -p ] [ file... ] DESCRIPTION
mkfatimage16 creates a hdimage file for DOSEMU that is pre-loaded with the files specified on the command line. The output is either writ- ten to stdout (hence do not forget to append " > hdimagefile", else you will see garbage on the screen) or to the file specified by the -f option. For the latter you may also use option -p in order to force padding up to the given size. This padding will result in so-called holes on an ext2-FS, hence the actual disk usage will not be greater. The file created by mkfatimage16 then can be used as a virtual drive, when defined in /etc/dosemu.conf. As long as -k is not given, the number of heads is always 4 and you have 17 sectors per head else it is adjusted accordingly. To vary the size, you may either use the -t option or specify the total amount of Kbytes via -k option. All files given behind the options will be copied onto the hdimage. In addition a DOSEMU suitable master boot record (MBR) is established and via option -b you may specify a boot sector that gets inserted as first sector of the partition. To later access the hdimage outside of DOSEMU you should use mtools (/etc/mtools.conf parameters partition=1 and offset=128). OPTIONS
-b file Insert the first 512 bytes of file into the bootsector of the partition. -t num Make the virtual disk have num tracks. This is the one way to define the size of the disk. -k Kbytes Make the virtual disk be Kbytes in size. Using -t and -k are mutual exclusive. -l label insert label as volume label for the disk. -f outfile The hdimage is written to outfile instead of stdout -p Pad the hdimage with zero up to the total size given by -t or -k (only in conjunction with -f). AUTHOR
Pasi Eronen (pe@iki.fi) and Peter Wainwright. BUGS
This program doesn't support name mangling and does very little checking for non-DOS filenames. Disk full condition isn't detected (and probably causes erratic behaviour). Duplicate files aren't detected. AVAILABILITY
Comes with DOSEMU SEE ALSO
dosemu(1), xdosemu(1), mtools(1) Version ALPHA 0.98 September, 1998 MKFATIMAGE16(1)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy