Sponsored Content
Full Discussion: spacing question
Top Forums UNIX for Dummies Questions & Answers spacing question Post 72579 by zazzybob on Sunday 22nd of May 2005 10:30:08 AM
Old 05-22-2005
Code:
s/^.*(cool).*$/\1/

s/ - substitute
^ - beginning of line
.* - any number of anything
(cool) - if we find cool, remember that we find it - same as \(cool\) in sed
.* - any number of anything again
$ - end of line
/\1/ - replace the whole line with whatever we remembered

This is very "conceptual" - read a good regex book for more - you can have multiple \( \) and then shuffle the order of things about, e.g.
Code:
$ echo "three words here" | sed 's/^\([^ ]*\) \([^ ]*\) \([^ ]*\)/\2 \3 \1/'
words here three

Again, a full regular expression tutorial is beyond the scope of any thread... Google will be your friend here...

Cheers
ZB
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

character spacing issue

I have a script that has a counter in it, the output from the script puts the values in columns, and when the values are greater than 9 it moves the rest of the row over, hence displacing the columns. Is their something I can do to make these values fit in their respective column? I tried typing an... (1 Reply)
Discussion started by: wxornot
1 Replies

2. Shell Programming and Scripting

How to adjust spacing

Is there a way to adjust spacing of a line using k shell? e.g I have a file below $ cat file1 AAA BBB CCC A B C AAAA BB CC I want each word to be adjusted with spaces to have 10 character length like below: AAA BBB CCC A B C AAAA BB CC Any... (4 Replies)
Discussion started by: stevefox
4 Replies

3. Shell Programming and Scripting

PERL array spacing

lines in: 4,355,384 20,762,557 16,407,173 TOTAL 14,470,261 27,190,250 12,719,989 TOTAL 18,825,645 47,952,807 29,127,162 TOTAL PERL script: open(TOTAL,"grepTOTAL /otl/ds_metric/data_files/modem_times|"); push(@total,<TOTAL>);... (3 Replies)
Discussion started by: Jamison
3 Replies

4. Shell Programming and Scripting

spacing problem

Hi guys, I have this little code: for directory in / $(echo $path | tr '/' ' ' ) do cd $directory echo "$(ls -ld | cut -c2-10 | sed 's/.\{3\}/& /' | sed 's/.\{7\}/& /' | sed 's/.\{1\}/& /g')" " $directory" done The output of this will be showing the permissions with spaces so it will... (2 Replies)
Discussion started by: darkhider
2 Replies

5. Homework & Coursework Questions

Join command help with spacing

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I have to join 3 files numerically according to ID(first column) with no comments. In the end i'll be something... (0 Replies)
Discussion started by: bigubosu
0 Replies

6. Shell Programming and Scripting

Spacing between words

Hi I have a csv file in below format First Line=1 Second Line=2 And the third Line=3 Now comes the fourth Line=4 I want to insert spaces so that the output would be First Line=1 Second Line=2 And the third Line=3 Now comes the fourth Line=4 Can anyone help me do... (10 Replies)
Discussion started by: msivask
10 Replies

7. UNIX for Dummies Questions & Answers

Help with the spacing

while IFS="" read r; do printf "XXX\t%s\n" "$r" done < test1.txt > test.txt The issue is, XXX wud be a dummy column/row added to the file..But i want this XXX column to be a separated as a TAB Delimiter it should be something like XXX 1 XXX 2 (3 Replies)
Discussion started by: saggiboy10
3 Replies

8. UNIX for Dummies Questions & Answers

paste command without spacing?

I'm trying to combine text files without a space. So if i use the paste command paste file1 file2 file3 > file4 the new file created has spacing between the contents of the once individual files. Is there some trick I can do with a delimiter that removes the spaces.. like paste -d'' or... (1 Reply)
Discussion started by: steveinthebox
1 Replies

9. UNIX for Dummies Questions & Answers

output spacing and formatting

here is my code and output, i just want to display it clearly to the users. how can I fix the spacing or put some headers like NAME, DEV id, Size, Meta code: symdg show $INS-${SNAP} | egrep "D-" | awk '{print $1,$3,$NF,$5}' output: D-arch 23C2 983040 (M) D-db 0704 245760 (M) D-undo 07DB... (12 Replies)
Discussion started by: prodigy06
12 Replies

10. Shell Programming and Scripting

Uniform Spacing in the message

Hello, I am running a script which sends an output as an email; I am having issues with the spacing being not uniform in the message. Snippet of the code and email message below: if ] then echo "$Hostname\tMISSING\tHMCBackup" >> $BackupMsg else if ] then echo... (12 Replies)
Discussion started by: hasn318
12 Replies
WBAR(1) 						      General Commands Manual							   WBAR(1)

NAME
wbar - a light and fast launch bar SYNOPSIS
wbar [options] DESCRIPTION
This manual page documents briefly the wbar command. wbar is a quick launch bar. Its fast, light and cool eye-candy. OPTIONS
A summary of options is included below. --help Show summary of options. -config conf-file Use conf-file as wbar config file. -above-desk Run over a desktop app (ie: xfdesktop). -isize i Set icon size (eg: 32). -idist d Set icon dist (eg: 1). -zoomf z Set zoom factor (eg: 1.8 or 2.5). -jumpf j Set jump factor (eg: 1.0 or 0.0). -pos p Set position. Choose from top, bottom, left, right, center, <bot|top>-<right|left>. -dblclk ms Set ms for double click (0: single click). -bpress Icon gets pressed. -vbar Show vertical bar. -balfa i Set bar alfa (0-100). -falfa i Set unfocused bar alfa (0-100). -filter i Set color filter (0: none 1: hovered 2: others, 3: all). -fc 0xAARRGGBB Set filter color (default green 0xff00c800). -nanim i Set number of animated icons: 1, 3, 5, 7, 9, ... -nofont If set disables font rendering. AUTHOR
wbar was written by Rodolfo Granata <warlock.cc@gmail.com>. This manual page was written by Krzysztof Burghardt <krzysztof@burghardt.pl>, for the Debian project (and may be used by others). March 16, 2009 WBAR(1)
All times are GMT -4. The time now is 02:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy