Search Results

Search: Posts Made By: Dedalus
21,742
Posted By radoulov
The shell field/word splitting occurs only on...
The shell field/word splitting occurs only on expansion.

From the manual pages of bash:


So:

4.1.10(4)-release$ IFS=+
4.1.10(4)-release$ a=( one+two )
4.1.10(4)-release$ echo "${a[0]}"...
932
Posted By itkamaraj
$ nawk -F"[= ]" ' {if($1~/port/) {$6="\$"$1;...
$ nawk -F"[= ]" ' {if($1~/port/) {$6="\$"$1; print $0} else {print $0}} ' test
port1 $PORT && if [ $port1 -eq "$NUM"]; then ........
1,825
Posted By Corona688
That's an interesting request. It's hard to know...
That's an interesting request. It's hard to know your PID in advance!

But not impossible: The exec command can be used to replace your shell's PID with a command. The process being executed...
2,362
Posted By Scrutinizer
Indeed -r is GNU only .... + is not part of...
Indeed -r is GNU only ....

+ is not part of basic regular expressions. You would have to do something like this:
echo "a b c" | sed 's/ \{1,\}/ \& /g'
or this:
echo "a b c" |...
2,362
Posted By Corona688
I'm not sure what you're trying to do with \s. ...
I'm not sure what you're trying to do with \s. Is that Perl syntax? It's not in POSIX regular expressions.

Remember that the 's/this/that/' syntax replaces the text it matches. It doesn't put...
4,575
Posted By anbu23
sed "s/ *[^ ]*/&_label/" file
sed "s/ *[^ ]*/&_label/" file
4,575
Posted By kurumi
$ ruby -ane '$F[1]=$F[1]+"_label";puts $F.join("...
$ ruby -ane '$F[1]=$F[1]+"_label";puts $F.join(" ")' file
$ awk '{$2=$2"_label"}1' file
1,555
Posted By anbu23
paste is expecting filename and not the contents...
paste is expecting filename and not the contents of a file. You can use awk command and remove any lines which dont have "a" and then use paste command

$ cat file1
a 12
b 1
a 3
$ cat file2...
1,523
Posted By Scrutinizer
awk -F: '$4="\""$4"\""' OFS=: infile sed...
awk -F: '$4="\""$4"\""' OFS=: infile
sed 's/\([^:]*\)/"\1"/4' infile
sed 's/:/&"/3;s/:/"&/4' infile

---------- Post updated at 12:58 ---------- Previous update was at 12:38 ----------

This...
Showing results 1 to 9 of 9

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