Sponsored Content
Full Discussion: SED and wildcards
Top Forums UNIX for Dummies Questions & Answers SED and wildcards Post 302452460 by Xterra on Friday 10th of September 2010 01:54:35 PM
Old 09-10-2010
There you go
Quote:
>C0/C0_s15_C05_0_485
ATTAGATACCCGGGTAGTCCACGCCCTAAACGATGTCAACTGGTTGTTGGGTCTTCACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAATTTGCCAGAGATGGCTTAGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGG
>C0/C0_s15_C05_73_86
ATTAGATACCCCGGTAGTCCACGCCCTAAACGATGTCAACTGGTTGTTGGGTCTTCACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAATTTGCCAGAGATGGCTTAGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGG
>C0/C0_s15_C05_170_500
ATTAGATACCCTGGTAGTCCACGCCCTAAACGATGTCAACTGGTTGTTGGGTCTTCACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAATTTGCCAGAGATGGCTTAGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGG
>C0/C0_s15_C05_239_262
ATTAGATACCCGGGTAGTCCACGCCCTAAACGATGTCAACTGGTTGTTGGGTCTTCACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAAGTTACCAGAGATGGTTTCGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGGCTGTCGTC
>C0/C0_s15_C05_308_278
ATTAGATACCCTGGTAGTCCACGCCCTAAACGATGTCAACTGGTTGTTGGGTCTTCACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAAGTTACCAGAGATGGTTTCGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGGCTGTCG
>C0/C0_s15_C05_412_130
ATTAGATACCCCGGTAGTCCACGCCCTAAACGACGTCAACTGGTTGTTGGGTCTTAACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAAGGATCCAGAGATGGATTTGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGGCTGTCGTC
>C0/C0_s15_C05_443_221
ATTAGATACCCTGGTAGTCCACGCCCTAAACGACGTCAACTGGTTGTTGGGTCTTAACTGACTCAGTAACGAAGCTAACG
CGTGAAGTTGACCGCCTGGGGAGTACGGCCGCAAGGTTGAAACTCAAAGGAATTGACGGGGACCCGCACAAGCGGTGGAT
GATGTGGTTTAATTCGATGCAACGCGAAAAACCTTACCCACCTTTGACATGTACGGAAGGATCCAGAGATGGATTTGTGC
TCGAAAGAGAACCGTAACACAGGTGCTGCATGGCTGTCG
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Wildcards in VI

I'm trying to delete lines from a large text file using VI. Every line that I am wanting to delete start with 'S' - all others do not. (A list of users) I've tried using * but doesn't seem to like it...any ideas... Doesn't have to be VI - but I'm better with VI than sed/awk. (8 Replies)
Discussion started by: peter.herlihy
8 Replies

2. UNIX for Dummies Questions & Answers

wildcards

when writing a shell script (bourne) and using a unix command like 'ls' is there anything special you need to do to use a wildcard (like *)? (3 Replies)
Discussion started by: benu302000
3 Replies

3. UNIX for Dummies Questions & Answers

ls with wildcards

ok, I'm trying to write a script file that lists files with specific elements in the name into a txt file, it looks like this ls s*.dat > file_names.txt can't figure out whats wrong with that line, any ideas? thanks in advance (10 Replies)
Discussion started by: benu302000
10 Replies

4. Shell Programming and Scripting

Wildcards in SED

Hi Folks Quick one I can't seem to figure out sed wildcards.. I need to replace a string such as "From here.....to here". I would think the command would look like: sed 's/From here*to here/new text/g' or sed 's/From here\*to here/new text/g' But it's not working for me. Thanks in... (5 Replies)
Discussion started by: HealthyGuy
5 Replies

5. UNIX for Dummies Questions & Answers

wildcards NOT

Hi All Please excuse another straightforward question. When creating a tar archive from a directory I am attempting to use wildcards to eliminate certain filetypes (otherwise the archive gets too large). So I am looking for something along these lines. tar -cf archive.tar * <minus all *.rst... (5 Replies)
Discussion started by: C3000
5 Replies

6. Shell Programming and Scripting

Use wildcards in a script

Hello I have this script: #!/bin/ksh INPUTFILE=$1 TEMPFILE=$INPUTFILE.$$ OUTPUTFILE=$INPUTFILE.new # nr of arguments has to be 1 if then echo "\nUsage: $0 inputfile\n" return 1 fi # inputfile must exist and be readable if then (13 Replies)
Discussion started by: emferrari
13 Replies

7. Shell Programming and Scripting

SED with Wildcards and Special Characters

Hi All, Need you guys' help to achieve the following: I have some strings and i wish to threw off the end part that's in the file path. From: /directoryname1/subdirectoryname1/abc.txt /directoryname2/subdirectoryname2/defggf.txt To: /directoryname1/subdirectoryname1/... (7 Replies)
Discussion started by: Radeon
7 Replies

8. UNIX for Dummies Questions & Answers

wildcards in path

Is there some rule about using wildcards in path? Say I want to create a file, but one of the directories in the path is called 1433d.default and on different machines it will be called <some other string>.default touch ~/Library/Application/*.default/myfile In theory I thought that... (5 Replies)
Discussion started by: glev2005
5 Replies

9. UNIX for Advanced & Expert Users

Wildcards

These 2 websites do a GREAT job of explaining different types of wildcards. I learned about the categories of characters which I never knew about at all. GNU/Linux Command-Line Tools Guide - Wildcards GREP (1 Reply)
Discussion started by: cokedude
1 Replies

10. Shell Programming and Scripting

Using Wildcards in scp

to scp using windcards you use the following : scp 'hostname:/home/username/diff_201110*' . Enjoy ! (0 Replies)
Discussion started by: phpsnook
0 Replies
SHELL-QUOTE(1)						User Contributed Perl Documentation					    SHELL-QUOTE(1)

NAME
shell-quote - quote arguments for safe use, unmodified in a shell command SYNOPSIS
shell-quote [switch]... arg... DESCRIPTION
shell-quote lets you pass arbitrary strings through the shell so that they won't be changed by the shell. This lets you process commands or files with embedded white space or shell globbing characters safely. Here are a few examples. EXAMPLES
ssh preserving args When running a remote command with ssh, ssh doesn't preserve the separate arguments it receives. It just joins them with spaces and passes them to "$SHELL -c". This doesn't work as intended: ssh host touch 'hi there' # fails It creates 2 files, hi and there. Instead, do this: cmd=`shell-quote touch 'hi there'` ssh host "$cmd" This gives you just 1 file, hi there. process find output It's not ordinarily possible to process an arbitrary list of files output by find with a shell script. Anything you put in $IFS to split up the output could legitimately be in a file's name. Here's how you can do it using shell-quote: eval set -- `find -type f -print0 | xargs -0 shell-quote --` debug shell scripts shell-quote is better than echo for debugging shell scripts. debug() { [ -z "$debug" ] || shell-quote "debug:" "$@" } With echo you can't tell the difference between "debug 'foo bar'" and "debug foo bar", but with shell-quote you can. save a command for later shell-quote can be used to build up a shell command to run later. Say you want the user to be able to give you switches for a command you're going to run. If you don't want the switches to be re-evaluated by the shell (which is usually a good idea, else there are things the user can't pass through), you can do something like this: user_switches= while [ $# != 0 ] do case x$1 in x--pass-through) [ $# -gt 1 ] || die "need an argument for $1" user_switches="$user_switches "`shell-quote -- "$2"` shift;; # process other switches esac shift done # later eval "shell-quote some-command $user_switches my args" OPTIONS
--debug Turn debugging on. --help Show the usage message and die. --version Show the version number and exit. AVAILABILITY
The code is licensed under the GNU GPL. Check http://www.argon.org/~roderick/ or CPAN for updated versions. AUTHOR
Roderick Schertler <roderick@argon.org> perl v5.16.3 2010-06-11 SHELL-QUOTE(1)
All times are GMT -4. The time now is 12:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy