Sponsored Content
Top Forums Shell Programming and Scripting exclude characters in echo command please help Post 302365194 by fpmurphy on Monday 26th of October 2009 09:35:35 AM
Old 10-26-2009
No need to use sed
Code:
echo ${a:16} "${RESULT}" >> results_data_srcip

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to echo password characters

Hi All, I was wondering, how can I echo password using a character such as '*' in unix? In my machine, password is not echoed, so it is only blank space when I enter any password. So, when I enter a command such as "lock", how can I set the echo character to "*" or something else for... (4 Replies)
Discussion started by: mukluk
4 Replies

2. Shell Programming and Scripting

awk and sed, how to exclude certain characters

Hello everyone: I have ran into this a few times now where my skills are just not up to snuff when it comes to Unix. So, I came here to find some beard stroking Unix wizard to help me. Basically, I am using OS X 10.5 in large scale at work and sometimes I have to run some custom reports. ... (5 Replies)
Discussion started by: tlarkin
5 Replies

3. Shell Programming and Scripting

Find command with exclude

I had a Shell script that removes the files that are in a directory older than the specified days. find /test/files -mtime +10 I would like to add another condition to the find command above that is to exclude any file starting with ‘CGU' Thanks (1 Reply)
Discussion started by: db2dbac
1 Replies

4. Shell Programming and Scripting

Echo is replacing characters

Hi All, I'm using KSH and am writing a small script that counts the lines of various files in several folders under one root folder. Below is the script: #!/usr/bin/ksh common_path_in="/interface_in/rsc" file_out="/interface_in/rsc/record_count.csv" tot_rec_count=-1 act_rec_count=-1... (5 Replies)
Discussion started by: jagari
5 Replies

5. Shell Programming and Scripting

working with tar exclude command

i have issue with tar, let me explain when i run below command it works perfectly as usual. tar -cvf /tmp/temp.tar --exclude="exclusion expression" dir my requirement is --exclude="exclusion expression" will come from another variable. so when i execute below command: tar -cvf... (2 Replies)
Discussion started by: ajayyadavmca
2 Replies

6. AIX

Exclude Directories in my tar command

Hi, im having some issues after i execute the next command: tar -cvf /varios/restore/test.tar -X /jfma/test1/excludefile /jfma | gzip -c > /varios/restore/test.tar.gz this creates the desired "test.tar.gz" file, but whe i try to open it it says "tar: 0511-164 There is a media read or write... (6 Replies)
Discussion started by: blacksteel1988
6 Replies

7. Shell Programming and Scripting

How-To Exclude Directory in find command

How can i tweak the below find command to exclude directory/s -> "/tmp/logs" find . -type f \( ! -name "*.log*" ! -name "*.jar*" \) -printNote: -path option/argument does not work with the version of find that i have. bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v (7 Replies)
Discussion started by: mohtashims
7 Replies

8. Shell Programming and Scripting

Exclude directories in FIND command

Can you please help tweak the below command to exclude all directories with the name "logs" and "tmp" find . -type f \( ! -name "*.tar*" ! -name "*.bkp*" \) -exec /usr/xpg4/bin/grep -i "user_1" /dev/null {} + >result.out bash-3.2$ uname -a SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v... (9 Replies)
Discussion started by: mohtashims
9 Replies

9. UNIX for Beginners Questions & Answers

To remove any invisible and special characters from the file(exclude @!#$&*)

Hi Guys, My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$% abc|xyz|acd¥£ó adc|123| 12áí Please help on this. Thanks Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies

10. UNIX for Advanced & Expert Users

To remove any invisible and special characters from the file(exclude @#!$*)

Hi Guys, My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$% abc|xyz|acd¥£ó adc|123| 12áí Please help on this. Thanks Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 03:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy