Search Results

Search: Posts Made By: unknown7
12,461
Posted By Ygor
You can just use sed....sed '/PATTERN/s/ to be...
You can just use sed....sed '/PATTERN/s/ to be changed/, YEHA! to be changed/' FILENAME
1,527
Posted By vbe
Not sure... All I can see is that your...
Not sure...
All I can see is that your "command" is the same... but does not the same so I would imagine a first script that formats for you (correct command and output) then to not call the correct...
3,588
Posted By Corona688
system("ls -la"); You can't directly capture...
system("ls -la"); You can't directly capture their output like backticks though, as far as I know. You might be able to redirect into a file then read the file after.
3,588
Posted By panyam
Use nawk or /usr/xpg4/bin/awk on Solaris.
Use nawk or /usr/xpg4/bin/awk on Solaris.
3,588
Posted By ahamed101
Works for me :-/ [root@D152153 tmp]# awk...
Works for me :-/


[root@D152153 tmp]# awk 'NR==FNR\
{
a[++i]=$0;next
}
{
b[++j]=$0;
}
END\
{
for(k=1;k<=j;k++)
{
print "COMMAND " a[k] " COMMAND_OPTION " b[k]
}...
1,866
Posted By ctsgnb
s/.../.../ the & refer to what has...
s/.../.../

the & refer to what has previously been matched in the whole pattern space (here within the first /.../ )

This example would put the third column at the firt column:...
16,550
Posted By panyam
SCRIPTS>awk -F"," '{print...
SCRIPTS>awk -F"," '{print $1,$2,(($3-$4)>0?$3-$4:$3)}' OFS="," input_file
2,362
Posted By Shell_Life
Please, first verify if you do not have in your...
Please, first verify if you do not have in your input file the octal 251 which is ©.

If you do, then choose another special character that is not in your file.

#!/usr/bin/ksh
typeset -i mLen...
2,362
Posted By |UVI|
cat input.txt | awk '{ if...
cat input.txt | awk '{
if (length($0)+length(APPEND) < 20 ){
TMP = APPEND $0
gsub(/\\/,"",TMP)
print TMP
APPEND=""
}else{

TMP = APPEND $0
gsub(/\\/,"",TMP)
LINE = substr(TMP,1,19)...
2,362
Posted By Shell_Life
See if this works for you: #!/usr/bin/ksh ...
See if this works for you:
#!/usr/bin/ksh
typeset -i mLen
mPrevLine=''
sed 's/\\//' Inp_File | while read mLine
do
mLine2=${mPrevLine}${mLine}
mLen=${#mLine2}
if [[ ${mLen} -ge 20 ]];...
3,530
Posted By suresh.boddepu
TRY
sed 's/\/$//g' inputfile | awk '{ORS="";print}'|xargs| sed 's/\/$//g'
3,530
Posted By pravin27
Let's try with perl. perl -ne 'chop $_;printf...
Let's try with perl.
perl -ne 'chop $_;printf $_; END {printf "\n";}' input.txt
3,530
Posted By cgkmal
Lets try with: echo "abc/de/fg/ 12/3/4/5/67/ ...
Lets try with:
echo "abc/de/fg/
12/3/4/5/67/
morestuff/" | sed 's/\/$//' | tr -d "\n"
abc/de/fg12/3/4/5/67morestuffRegards
4,890
Posted By ctsgnb
xargs -n1 | displays 1 string per line sed...
xargs -n1 | displays 1 string per line
sed '/\//!d' | will delete every lines that do NOT contain a slash (the negation "NOT" is specified by the bang"!")
3,530
Posted By Perderabo
What system are you using? It works for me on...
What system are you using? It works for me on Solaris and Linux.

-n means do not print lines unless instructed to.
{} groups commands together
N reads another line
p prints
4,890
Posted By ctsgnb
awk '/\/folder1\/folder2\/folder3\//{print$2}'...
awk '/\/folder1\/folder2\/folder3\//{print$2}' get_info_file >/tmp/grepoutputor nawk on solaris
nawk '/\/folder1\/folder2\/folder3\//{print$2}' get_info_file >/tmp/grepoutput
4,890
Posted By panyam
@panyam I had a try - thanks for the fast...
@panyam
I had a try - thanks for the fast response
using:
grep "/folder1/folder2/folder3/" rem | cut -d" " -f2 INPUTFILE


It suppose to be:


grep "/folder1/folder2/folder3/"...
4,890
Posted By panyam
grep "/folder1/folder2/folder3/" INPUTFILE| cut...
grep "/folder1/folder2/folder3/" INPUTFILE| cut -d" " -f2
3,917
Posted By Aia
Assuming that $(BUILDPATH) is a command that...
Assuming that $(BUILDPATH) is a command that returns a string. You need to take a look at what your shell needs concerning quotation and shell variables in sed.
Highlighting some points you should...
Showing results 1 to 19 of 19

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