Search Results

Search: Posts Made By: sikku
5,173
Posted By sikku
zenity progress and simultaneously terminal output
Hi,

I want to use zenity --progress and also put the output to the terminal.

I tried using the tee command but that puts the output to the terminal first and then shows the zenity progress...
9,263
Posted By sikku
You are using this reg exp [^:]* only twice,...
You are using this reg exp [^:]* only twice, which means only two tokens are considered while swapping?
Is this the reason the third token does not get affected?
9,263
Posted By sikku
Thanks for the help.. Basically what does...
Thanks for the help..

Basically what does this code do?

sed 's/^\([^:]*\):\([^:]*\)/\2:\1/'

Can you please explain?
9,263
Posted By sikku
echo $string1 $string2 | tr ' ,|' '\n\n\n' | pr...
echo $string1 $string2 | tr ' ,|' '\n\n\n' | pr -2 -t -s: | xargs

That did the trick... So I was doing something which was not required at all...

How about the other script? I am not able to...
9,263
Posted By sikku
string3 is already built. ...
string3 is already built.

string1="abc|def|hij"
string3="123:1|134:2|145:3"

I need this from string1 and string3
string5="123:abc:1 134:def:2 145:hij:3"

Thanks for the first script...
...
9,263
Posted By sikku
I have a new situation now: ...
I have a new situation now:

string1="abc|def|hij"
string2="1212,2134,1245"
string3="123:1,134:2,145:3"

string4="abc:1212 def:2134 hij:1245"
string5="123:abc:1 134:def:2 145:hij:3"...
9,263
Posted By sikku
In fact my script should be like this: ...
In fact my script should be like this:

#!/bin/ksh

string1="abc|def|hij"
string2="1212|2134|1245"
string3="123:1|134:2|145:3"

string4="`paste -d: <(echo $string1 | sed 's/\|/ /g' | xargs...
9,263
Posted By sikku
@ctsgnb: This is the content of my script ...
@ctsgnb:

This is the content of my script

#!/bin/ksh

string1="abc|def|hij"
string2="123:1|134:2|145:3"

#string3="`paste -d: <((echo $string2 | sed 's/\|/ /g' | xargs -n1) | cut -f1 -d:)...
9,263
Posted By sikku
The latest one works in the command line but not...
The latest one works in the command line but not in the script.
echo "$string1 $string2" | tr ' |' '\n\n' | pr -2 -t -s: | sed 's/^\([^:]*\):\([^:]*\)/\2:\1/' | xargs
the following one works in...
9,263
Posted By sikku
I told you, it behaves in a different way. $...
I told you, it behaves in a different way.

$ echo "$string1 $string2"
abc|def|hij 123:2|124:1|125:3

$ echo "$string1 $string2" | tr ' |' '\n'
abc|def|hij
123:2|124:1|125:3

$ echo...
9,263
Posted By sikku
@ctsgnb Dint work for me. :( Maybe I am using...
@ctsgnb
Dint work for me. :(
Maybe I am using sun OS?

$ echo $string1
abc|def|hij
$ echo $string2
123:1|124:2|125:3
$ echo "$string1 $string2" | tr ' |' '\n' | pr -2ts: | sed...
9,263
Posted By sikku
@ctsgnb Thanks. Your code also worked. I...
@ctsgnb Thanks.

Your code also worked.
I have small change in the string2 and want the output in a different way now

string1=abc|def|ghi
string2=123:2|124:1|125:3

the format is like this...
9,263
Posted By sikku
It worked fine in ksh. Thanks for the help. But...
It worked fine in ksh. Thanks for the help.
But it gives wrong results for strings of different length.
Any idea to restrict it to the smaller string among the both?
9,263
Posted By sikku
Thanks. It runs from the command line, but not...
Thanks.
It runs from the command line, but not from the script file.
Any idea?

I am running this script as
#!/bin/sh
9,263
Posted By sikku
Join 2 separate strings into one with alternate tokens.
Hi,

I have two strings eg:
string1=abc|def|hij
string2=12|13|14

I want a new string with
string3="abc:12 def:13 hij:14"

I am using shell scripting. Is there any method to do this?

I...
2,671
Posted By sikku
@itkamaraj That was awesome. It works fine. ...
@itkamaraj
That was awesome. It works fine.
Can you tell me how to extract only the day or month from it?
Like
$date +%d

will give you only the current day.
2,671
Posted By sikku
I am using Sun OS. Those commands dont work. It...
I am using Sun OS.
Those commands dont work. It says illegal options
2,671
Posted By sikku
Pipe with extra argument
Hi,

I want to pipe an output to another command with an extra argument. Can anyone tell me how is it possible?

Eg:
$date +%d
will give the current date. I want to add 1 to it and give it as...
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy