10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear all,
I would like to insert N blankspaces in front of a string using sed command
To give an example (N=10), I tried that code:
$ echo "abcd" | sed 's/^/ \{10,\}&/'
but I failed, by obtaining that result:
{10,}abcd
Any help would be greatly appreciated,
Thanks in advance,... (18 Replies)
Discussion started by: dae
18 Replies
2. Shell Programming and Scripting
Hi all...
This is more of a concensus question than help...
As many of you know I am experimenting with the limitations of Pure POSIX shell scripting.
Q: Is the directory /bin considered part of the Pure POSIX shell or must I stick entirely with the builtins only?
The reason is I... (2 Replies)
Discussion started by: wisecracker
2 Replies
3. UNIX for Dummies Questions & Answers
Hello, newb here :o
How do I add square brackets before and after the first character in a string using sed?
e.g.
0123456
123456
My attempts have been fruitless.
sed 's/.\{0\}//'
Thanks. (2 Replies)
Discussion started by: shadyuk
2 Replies
4. Shell Programming and Scripting
i have written a shell script that reads a csv file and inserts tokenized strings into the database.
the problem comes when the csv file has cyrillic characters.
how do i set the parameters in my shell script(korn shell) so that any characters can be inserted into the database. (3 Replies)
Discussion started by: vkca
3 Replies
5. Shell Programming and Scripting
Hey all,
Fist post, so be kind... I have written an expect script which logs into a terminal and gathers several screens of information. Unfortunately the log file gives me all the special escape and control characters from the terminal. I am hoping to use a combination of shell scripting, sed,... (1 Reply)
Discussion started by: mpacer
1 Replies
6. Shell Programming and Scripting
Input:
Youcaneasilydothisbyhighlightingyourcode.
Putting space after three characters.
You can eas ily dot his byh igh lig hti ngy our cod e.
How can i do this using sed? (10 Replies)
Discussion started by: cola
10 Replies
7. Shell Programming and Scripting
Hi Experts,
I have called some.txt with the following content.
oracle HYRDSRVIHUB01 pts/0 TESTIHUB 07-JUN-10 CREATE TABLE
TESTIHUB PHONE ... (12 Replies)
Discussion started by: naree
12 Replies
8. Shell Programming and Scripting
Hi,
I want to test a unix file by inserting greek characters in to vi editor.
Can anyone please suggest how to insert greek characters in to vi editor. (2 Replies)
Discussion started by: DSDexter
2 Replies
9. Shell Programming and Scripting
I need to add spaces in between characters in a string variable.
Is there a shortcut? I know you can remove the spaces with sed, but does sed have a way to add them?
Example:
I have: DATA01
I want it to be: D A T A 0 1
What I have done so far is to create a function... (4 Replies)
Discussion started by: heyindy06
4 Replies
10. Shell Programming and Scripting
I am trying to strip all leading and trailing spaces of a shell variable using either awk or sed or any other utility, however unscuccessful and need your help.
echo $SH_VAR | command_line Syntax.
The SH_VAR contains embedded spaces which needs to be preserved. I need only for the leading and... (6 Replies)
Discussion started by: jerardfjay
6 Replies