Sponsored Content
Top Forums Shell Programming and Scripting awk gsub not working as expected Post 303008082 by pradyumnajpn10 on Monday 27th of November 2017 06:00:27 AM
Old 11-27-2017
Thank you Rudic and Don Cragun for your valuable time.. You Rock..Smilie
I will dig more into the + sign you have mentioned and the third valuable statement


Long live Unix.com
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

which not working as expected

Hello. Consider the following magic words: # ls `which adduser` ls: /usr/sbin/adduser: No such file or directory # Hmmm... Then: # ls /usr/sbin/adduser /usr/sbin/adduser # Now what? Unforunately this little sniippet is used in my debian woody server's mysql pre install script.... (2 Replies)
Discussion started by: osee
2 Replies

2. Shell Programming and Scripting

awk not working as expected with BIG files ...

I am facing some strange problem. I know, there is only one record in a file 'test.txt' which starts with 'X' I ensure that with following command, awk /^X/ test.txt | wc -l This gives me output = '1'. Now I take out this record out of the file, as follows : awk /^X/ test.txt >... (1 Reply)
Discussion started by: videsh77
1 Replies

3. Shell Programming and Scripting

Var substitution in awk - not working as expected

countA=`awk '/X/''{print substr($0,38,1)}' fName | wc -l` countB=`wc -l fName | awk '{print int($1)}'` echo > temp ratio=`awk -va=$countA -vc=$countB '{printf "%.4f", a/c}' temp` After running script for above I am getting an error as : awk: 0602-533 Cannot find or open file -vc=25. The... (3 Replies)
Discussion started by: videsh77
3 Replies

4. Shell Programming and Scripting

Why this is not working in expected way?

total=0 seq 1 5 | while read i ; do total=$(($total+$i)) echo $total done echo $totalThis outputs: 1 3 6 10 15 0whereas I am expecting: 1 3 6 10 15 15My bash version: (4 Replies)
Discussion started by: meharo
4 Replies

5. Shell Programming and Scripting

bash variable (set via awk+sed) not working as expected

Hi! Been working on a script and I've been having a problem. I've finally narrowed it down to this variable I'm setting: servername=$(awk -v FS=\/ '{ print $7 } blah.txt | sed 's\/./-/g' | awk -v FS=\- '{print $1}')" This will essentially pare down a line like this: ... (7 Replies)
Discussion started by: creativedynamo
7 Replies

6. UNIX for Dummies Questions & Answers

Gsub regex not working

I have a number of files that I pass through awk/gsub. I believe to have found a working regex and on 'test bed' sites it matches, however within gsub it does not. Examples: Initial data: /Volumes/Daniel/Public/Drop Box/_Hellsing_Ultimate_OVA_-_10_.mkv gsub & regex: gsub("\]+\]","" ... (4 Replies)
Discussion started by: unknownn
4 Replies

7. Shell Programming and Scripting

Script not working as expected

Hi, I have prepared a script and trying to execute it but not getting expected output. Could you please help and advise what is going wrong. "If else" part in below script is not working basically. I am running it on HP-UX. for i in slpd puma sfmdb do echo "******\t$i\t*******" echo... (10 Replies)
Discussion started by: sv0081493
10 Replies

8. Shell Programming and Scripting

awk not working as expected in script

Dear all, I had script which used to work, but recently it is not working as expected. I have command line in my shell script to choose the following format from the output_elog and perform some task afterwards on As you see, I want all numbers in foramt following RED mark except for... (12 Replies)
Discussion started by: emily
12 Replies

9. Shell Programming and Scripting

awk command not working as expected

Following one line of awk code removes first 3 characters from each line but when I run the same code on another linux platform it doesn't work and only prints blank lines for each record. Can anyone please explain why this doesn't work? (31 Replies)
Discussion started by: later_troy
31 Replies

10. Shell Programming and Scripting

awk matching script not working as expected

This is my ubuntu version: $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.4 LTS Release: 16.04 Codename: xenial $ /bin/awk -V | head -n1 bash: /bin/awk: No such file or directory I have gotten a script that helps me to parse,... (14 Replies)
Discussion started by: delbroooks
14 Replies
MOUNT_CD9660(8) 					    BSD System Manager's Manual 					   MOUNT_CD9660(8)

NAME
mount_cd9660 -- mount an ISO-9660 filesystem SYNOPSIS
mount_cd9660 [-o options] special node DESCRIPTION
The mount_cd9660 command attaches the ISO-9660 filesystem residing on the device special to the global filesystem namespace at the location indicated by node. Both special and node are converted to absolute paths before use. The options are as follows: -o Options are specified with a -o flag followed by a comma separated string of options. Besides options mentioned in mount(8) man page, following cd9660-specific options are supported: extatt Enable the use of extended attributes. gens Do not strip version numbers on files and leave the case of the filename alone. (By default, uppercase characters are trans- lated to lowercase, and if there are files with different version numbers on the disk, only the last one will be listed.) In either case, files may be opened without giving a version number, in which case you get the last one, or by explicitly stating a version number (albeit it's quite difficult to know it, if you are not using the gens option), in which case you get the specified version. nocasetrans A synonym for nomaplcase. nojoliet Do not make use of Joliet extensions for long filenames which may be present in the filesystem. Interpretation of Joliet extensions is enabled by default, Unicode file names are encoded into UTF-8. nomaplcase File names on cd9660 cdrom without Rock Ridge extension present should be uppercase only. By default, cd9660 recodes file names read from a non-Rock Ridge disk to all lowercase characters. nomaplcase turns off this mapping. norrip Do not use any Rockridge extensions included in the filesystem. nrr Same as norrip. For compatibility with Solaris only. rrcaseins Makes all lookups case-insensitive even for CD-ROMs with Rock-Ridge extensions (for Rock-Ridge, default is case-sensitive lookup). For compatibility with previous releases, following obsolete flags are still recognized: -e Same as -o extatt. -j Same as -o nojoliet. -g Same as -o gens. -r Same as -o norrip. SEE ALSO
mount(2), unmount(2), fstab(5), mount(8), mscdlabel(8) HISTORY
The mount_cd9660 utility first appeared 4.4BSD. Support for Joliet filesystem appeared in NetBSD 1.4. Options nomaplcase and rrcaseins were added in NetBSD 1.5. UTF-8 encoding of Unicode file names for Joliet filesystems was added in NetBSD 3.0. NOTES
For Joliet filesystems, the Unicode file names used to be filtered to ISO-8859-1 character set. This changed in NetBSD 3.0, file names are encoded into UTF-8 now by default. The behaviour is controllable by the vfs.cd9660.utf8_joliet sysctl; the former behaviour is available by setting it to 0. BUGS
For some cdroms the information in the Rock Ridge extension is wrong and the cdrom needs to be mounted with "norrip". A sign that something is wrong is that the stat(2) system call returns EBADF causing, e.g., "ls -l" to fail with "Bad file descriptor". The cd9660 filesystem does not support the original "High Sierra" ("CDROM001") format. POSIX device node mapping is currently not supported. Version numbers are not stripped if Rockridge extensions are in use. In this case, you have to use the original name of the file as recorded on disk, i.e. use uppercase and append the version number to the file. There is no ECMA support. BSD
January 3, 2009 BSD
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy