Sponsored Content
Top Forums Shell Programming and Scripting Adding gaps to a string in bash Post 302882778 by kristinu on Thursday 9th of January 2014 06:17:21 AM
Old 01-09-2014
Have got another method, however I need to put $gap in the sed statement. How can I pass the gap?

Code:
echo "$frmt_k1d1_test" | sed 's/.../&$gap/g'

---------- Post updated at 06:17 AM ---------- Previous update was at 06:14 AM ----------

Quote:
Originally Posted by chacko193
Try this
Code:
aLongSpace="                                                                                                            "
gap=8
frmt_k1d1_test="%s${aLongSpace:0:$gap}%s\n"
echo "$frmt_k1d1_test"

This works, however I originally have the string

Code:
frmt_k1d1_test="%s    %s\n"

Modification should be done using this string as initial input.
 

8 More Discussions You Might Find Interesting

1. Linux

Searching for gaps in huge (2.2G) log file?

I've got a 2.2 Gig syslog file from our Cisco firewall appliance. The problem is that we've been seeing gaps in the syslog for anywhere from 10 minutes to 2 hours. Currently I've just been using 'less' and paging through the file to see if I can find any noticeable gaps. Obviously this isn't the... (3 Replies)
Discussion started by: deckard
3 Replies

2. OS X (Apple)

Adding Color to bash

Hey everyone, I have come across an issue to where I am trying to create a script which changes the text color with a simple if then statement. I have seen it done with Fedora 8 but when I try and create it using my MacBook Pro running Snow Leopard it doesn't work. Funny thing is, when I use... (2 Replies)
Discussion started by: dachadster13
2 Replies

3. Shell Programming and Scripting

Searching for Gaps in Time

I am very new to shell scripting. We use C-Shell here and I know the issues that surround it. I hope a solution can be created using awk, sed, etc... instead of having to write a program. I have an input file that is sorted by date and time in ascending order ... (2 Replies)
Discussion started by: jclanc8
2 Replies

4. Shell Programming and Scripting

bash adding multiple names

Hi all, I make this bash script in which there is one option to add a name in txt file. So when I run the script it ask me for the name. When i enter the name, that name gets added in a txt file. If i add the same name again, the message comes up, the name is already there My question is..... (2 Replies)
Discussion started by: Learnerabc
2 Replies

5. Shell Programming and Scripting

Sorting and moving file sequence with gaps

Hello, I have lots of sequentially numbered files which make up an image sequence. I'm trying to do two things with it: #1: Find gaps in the sequence and move each range of sequencial files into their own subfolder. #2: Designate a starting point (file) and move every 24th file into... (4 Replies)
Discussion started by: ex_H
4 Replies

6. Shell Programming and Scripting

Adding Content to Variable (bash)

is this possible? its kind of like incrementing the value of a number in a variable. but in this case, instead of the value of the variable being a number, it's just contents/strings/characters/alpha-numeric etc. NOT a number. For instance: VAR=Tommy for all in $(blah blah) do ... (2 Replies)
Discussion started by: SkySmart
2 Replies

7. UNIX for Dummies Questions & Answers

Gaps and frequencies

I have this infile: >GHL8OVD01BNNCA Freq 10 TAGATGTGCCCGTGGGTTTCCCGTCAACACCGGATAGT-GCAGCA-TA >GHL8OVD01CMQVT Freq 1 TTGATGTCGTGGGTTTCCCGTCAACACCGGCAAATAGT-GCAGCA-TA >GHL8OVD01CMQVT Freq 1 TTGATGTGCCAGTTTCCCGTCTAGCAGCACTACCAGGACCTTCGC-TA >GHL8OVD01CMQVW Freq 1... (1 Reply)
Discussion started by: Xterra
1 Replies

8. UNIX for Beginners Questions & Answers

Escape bash-special character in a bash string

Hi, I am new in bash scripting. In my work, I provide support to several users and when I connect to their computers I use the same admin and password, so I am trying to create a script that will only ask me for the IP address and then connect to the computer without having me to type the user... (5 Replies)
Discussion started by: arcoa05
5 Replies
PROBALIGN(1)							   User Commands						      PROBALIGN(1)

NAME
probalign - Align sequences in MFAFILE(s) and print result to standard output DESCRIPTION
PROBALIGN Version 1.4 (Nov 2010) aligns multiple protein sequences and prints to the standard output. Written by Satish Chikkagoudar and Usman Roshan using code from PROBCONS version 1.1 (written by Chuong Do) and based upon probA (written by Ulrike Muckstein). PROBALIGN 1.4 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the README file for details. Usage: probalign [OPTION]... [MFAFILE]... Description: Align sequences in MFAFILE(s) and print result to standard output -clustalw use CLUSTALW output format instead of MFA -v, --verbose report progress while aligning (default: off) -a, --alignment-order print sequences in alignment order rather than input order (default: off) -T, -temperature Sets the thermodynamic temperature parameter (default: 5 (for protein data mode), 1 ( for nucleotide data mode)). -score_matrix, --score_matrix Sets the type of scoring matrix used to calculate the posterior probabilities (default: gonnet_160, representing gonnet 160, refer README for details) -go, --gap-open This option can be used to specify the gap open parameter. The default for Gonnet 160 (protein) is 22 and nucleotide (simple matrix) is 4. -ge, --gap-extension This option can be used to specify the gap extension parameter. The default for Gonnet 160 (protein) is 1 and nucleotide (simple matrix) is 0.25. -nuc Specify this option to indicate that inputted sequences are nucleotide sequences -prot Specify this option to indicate that inputted sequences are protein sequences [DEFAULT] -showPP Outputs the posterior probabilities of alignment columns as a new sequence named Posterior Probabilities (The probability values are scaled to be between integers between 0 and 9). probalign 1.4 May 2011 PROBALIGN(1)
All times are GMT -4. The time now is 07:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy