Sponsored Content
Full Discussion: Help with bash shell script
Top Forums Shell Programming and Scripting Help with bash shell script Post 302571157 by akshu.agni on Sunday 6th of November 2011 12:08:21 PM
Old 11-06-2011
Thanks!! it is removing non ascii characters but, it it is removing pound(£) character which is there in other filed of the file. I want to retain pound character,

aim is to remove remove non ascii character only to that filed. Or in other way if highlighted filed has character other than P or Q then it should replace with empty value.

e.g
Sample File
------------
"Y3","I got £ 20","P","IO","PP"
"Y5","I got £ 20","Q","IO","PP"
"YY","I got £ 20","<88>","IO","PP"
"Y1","AK000022","ã","PO","PP"
"Y2","AK000022","¿","PO","PP"

Expected file
------------
"Y3","I got £ 20","P","IO","PP"
"Y5","I got £ 20","Q","IO","PP"
"YY","I got £ 20","","IO","PP"
"Y1","AK000022","","PO","PP"
"Y2","AK000022","","PO","PP"

Thanks
Aks

Last edited by akshu.agni; 11-06-2011 at 01:16 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need help with bash shell script

Hi guys! I have just started with shell programming!! I am having pronblem with variable subsitutuion. when i do egrep "*" marks this will give me the pattern match. but how can i catch the output of that result in a variable. if i say result = egrep "*" marks it gives me syntax... (2 Replies)
Discussion started by: vmtailor
2 Replies

2. UNIX for Dummies Questions & Answers

Bash shell script

Hi Guys, I am trying to alter a script for my company. I need the start of it to go something like this. User is asked to input 8 numbers 8 numbers are written to a txt file ***** ***** ***** txt file is read ***** ***** The text file gets read in between other files represented by... (2 Replies)
Discussion started by: outthere_3
2 Replies

3. Shell Programming and Scripting

Bash Shell script--need help

Hi all, i am beginner to unix and trying out a shell script which does the following. i have to calculate a persons salary. his salary is read from the keyboard. he has two types of deductions. 40% as dearness allowance and 20% as house rent. i have to print the gross salary. here is the code... (5 Replies)
Discussion started by: Irishboy24
5 Replies

4. Shell Programming and Scripting

Bash shell script- help

I need to invoke a program on remote server using ssh in a shell script. In addition i would like to capture date/time and if there is any errors , then script should write to log file. can someone please help me out? (1 Reply)
Discussion started by: sam101
1 Replies

5. Shell Programming and Scripting

Bash Shell Script

HELP!My program ends after entering one choice---need help making it take multiple inputs,instead of terminating after displaying just one #!/bin/bash# Crude address databaseclear # Clear the screen.echo " Contact List"echo " ------- ----"echo "Choose one of the following... (6 Replies)
Discussion started by: help123
6 Replies

6. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

7. Shell Programming and Scripting

Need help with bash shell script

I need to create digit day script that takes a single numeric argument and then it should print out the day of the week using the number modulo 7 formula e.g: 0 - Sunday 6- Saturday 131 - Friday I am fairly new to unix so I don't know how to use the number modulo 7 formula. Does the script need... (3 Replies)
Discussion started by: lukefrost96
3 Replies

8. Shell Programming and Scripting

Help with Bash shell script

Hi All, I have a script which as below #!/bin/bash for i in `cat servers` do ssh uname@$i "df -t xfs --total | grep total"; done > out.txtOutput as below -------------- total 140583991104 118622795524 21961195580 85% - total 140583991104 112888595524 27695395580 ... (4 Replies)
Discussion started by: npk
4 Replies

9. Shell Programming and Scripting

Different behavior between bash shell and bash script for cmd

So I'm trying to pass certain json elements as env vars and use them later on in a script. Sample json: JSON='{ "Element1": "file-123456", "Element2": "Name, of, company written in, a very weird way", "Element3": "path/to/some/file.txt", }' (part of the) script: for s... (5 Replies)
Discussion started by: da1
5 Replies

10. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies
DD(1)							      General Commands Manual							     DD(1)

NAME
dd - convert and copy a file SYNOPSIS
dd [option=value] ... DESCRIPTION
Dd copies the specified input file to the specified output with possible conversions. The standard input and output are used by default. The input and output block size may be specified to take advantage of raw physical I/O. option values if= input file name; standard input is default of= output file name; standard output is default ibs=n input block size n bytes (default 512) obs=n output block size (default 512) bs=n set both input and output block size, superseding ibs and obs; also, if no conversion is specified, it is particularly effi- cient since no copy need be done cbs=n conversion buffer size skip=n skip n input records before starting copy files=n copy n files from (tape) input seek=n seek n records from beginning of output file before copying count=n copy only n input records conv=ascii convert EBCDIC to ASCII ebcdic convert ASCII to EBCDIC ibm slightly different map of ASCII to EBCDIC lcase map alphabetics to lower case ucase map alphabetics to upper case swab swap every pair of bytes noerror do not stop processing on an error sync pad every input record to ibs ... , ... several comma-separated conversions Where sizes are specified, a number of bytes is expected. A number may end with k, b or w to specify multiplication by 1024, 512, or 2 respectively; a pair of numbers may be separated by x to indicate a product. Cbs is used only if ascii or ebcdic conversion is specified. In the former case cbs characters are placed into the conversion buffer, con- verted to ASCII, and trailing blanks trimmed and new-line added before sending the line to the output. In the latter case ASCII characters are read into the conversion buffer, converted to EBCDIC, and blanks added to make up an output record of size cbs. After completion, dd reports the number of whole and partial input and output blocks. For example, to read an EBCDIC tape blocked ten 80-byte EBCDIC card images per record into the ASCII file x: dd if=/dev/rmt0 of=x ibs=800 cbs=80 conv=ascii,lcase Note the use of raw magtape. Dd is especially suited to I/O on the raw physical devices because it allows reading and writing in arbitrary record sizes. To skip over a file before copying from magnetic tape do (dd of=/dev/null; dd of=x) </dev/rmt0 SEE ALSO
cp(1), tr(1) DIAGNOSTICS
f+p records in(out): numbers of full and partial records read(written) BUGS
The ASCII/EBCDIC conversion tables are taken from the 256 character standard in the CACM Nov, 1968. The `ibm' conversion, while less blessed as a standard, corresponds better to certain IBM print train conventions. There is no universal solution. Newlines are inserted only on conversion to ASCII; padding is done only on conversion to EBCDIC. These should be separate options. DD(1)
All times are GMT -4. The time now is 06:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy