Search Results

Search: Posts Made By: kraljic
3,349
Posted By anbu23
ls | awk -F"status_|[.]log" ' { print $2 }...
ls | awk -F"status_|[.]log" ' { print $2 } '
3,349
Posted By Neo
Something like this, also not very elegant: ...
Something like this, also not very elegant:

ubuntu# egrep -o '_.*[0-9]' test.log | cut --complement -c 1
vsbm1
OSMPRD1
fxmdbp1
cgsm1
cgsm2
cgsm3
cgsm4
cgsm5
SOACAT1
INTPHLK11
INTPHLK21...
1,656
Posted By Peasant
This is due sysfs being pseudo filesystem, as...
This is due sysfs being pseudo filesystem, as procfs is as well.

It's actually an interface from kernel space to user space which allows you to manipulate various options regarding your hardware...
1,293
Posted By RudiC
Or: awk '/;$/' fileorsed '/;$/!d' file
Or:
awk '/;$/' fileorsed '/;$/!d' file
1,293
Posted By apmcd47
Assuming your input is in a file called file.txt:...
Assuming your input is in a file called file.txt:
sed -n '/;$/p' file.txt
Or with grep:
grep ';$' file.txt

Andrew
1,240
Posted By apmcd47
You used ${1} instead of ${i} Andrew
You used ${1} instead of ${i}

Andrew
1,240
Posted By RudiC
You can't. In bash you'll need a loop to rename...
You can't.
In bash you'll need a loop to rename every single file.
You may want to consider the (perl?) rename tool.
838
Posted By RavinderSingh13
Hello kraljic, Could you please try...
Hello kraljic,

Could you please try following and let me know if this helps you.

awk '{print "PROMPT",$4 ORS $0}' Input_file


Thanks,
R. Singh
1,895
Posted By Scott
script's a good option I always forget about! ...
script's a good option I always forget about!

Alternatively alternatively, don't use tee and just read /var/log/yum.log :)
1,895
Posted By apmcd47
Alternatively use script. This starts a sub-shell...
Alternatively use script. This starts a sub-shell in your current terminal and saves all output to a file. After you have finished exit the sub-shell and the file is closed for review.

Andrew
1,895
Posted By Scott
If you provide the -y option to yum, you won't be...
If you provide the -y option to yum, you won't be asked about it. In case there are multiple questions (such as when it's also asking you about GPG keys), you may consider piping yum through yes, or...
2,845
Posted By rbatte1
Hello kraljic, I have a few to questions...
Hello kraljic,

I have a few to questions pose in response first:-
What have you tried so far?
What output/errors do you get?
What OS and version are you using?
What are your preferred...
2,845
Posted By RudiC
If you want to deploy awk, try awk -vLN=7...
If you want to deploy awk, try
awk -vLN=7 '{print > ("file" 2-(NR>LN))}' file
2,845
Posted By RavinderSingh13
Hello kraljic, Could you please try...
Hello kraljic,

Could you please try following and let me know if this helps you.

awk -v count=1 -v line=7 'NR>line &&!a{close("file"count);count++;a++} {print > "file"count}' FiLe1.txt
You...
1,001
Posted By drl
Hi. Some repetition, but also: Generate...
Hi.

Some repetition, but also:
Generate specific-size file

0) "dd", and other than Linux at:
...
1,001
Posted By MadeInGermany
Most if not all Linux distros are lacking mkfile....
Most if not all Linux distros are lacking mkfile.
The usual workaround is with dd
dd count=15 bs=1G </dev/zero >dummy
1,001
Posted By rbatte1
You don't state the OS version, so I don't know...
You don't state the OS version, so I don't know what tools you may already have to do this for you, and it depends what you want the file for.

There is a way in C that you open a new file,...
1,037
Posted By MadeInGermany
In awk the == operator compares two numbers or...
In awk the == operator compares two numbers or strings, in this case strings.
If they are equal the result is "true", a non-zero. The default action for a non-zero is {print}.
You can write this...
1,037
Posted By MadeInGermany
Print if the first word is pc (white space...
Print if the first word is pc (white space delimited)
awk '$1=="pc"'
1,037
Posted By Scrutinizer
Normally you would use: grep '^pc' I do...
Normally you would use:
grep '^pc'

I do not know if the leading spaces are present in the actual file. In that case you would need something like:
grep '^[[:blank:]]*pc'



--
Note: on...
1,758
Posted By apmcd47
Wouldn't sed "s/\(^.*\)$/exec...
Wouldn't
sed "s/\(^.*\)$/exec dbms_stats.gather_table_stats(ownname => 'SIEBEL', tabname => \1 ,degree => 3, cascade => true );/" pattern.txt

have done it with one substitution?

Andrew
PS...
1,758
Posted By RudiC
In fact, there's two substitute operations, the ...
In fact, there's two substitute operations, the ; separates the two. One (s/^/.../)substitutes the begin-of-line, the other (s/$/.../) the end-of-line.
1,758
Posted By RudiC
Why shell? Try sed "s/^/exec...
Why shell? Try
sed "s/^/exec dbms_stats.gather_table_stats(ownname => 'SIEBEL', tabname => /; s/$/ ,degree => 3, cascade => true );/" pattern.txt
1,758
Posted By MadeInGermany
Why sed? while read tableName do echo...
Why sed?
while read tableName
do
echo "exec dbms_stats.gather_table_stats(ownname => 'SIEBEL', tabname => '$tableName', degree => 3, cascade => true );"
done < pattern.txt
1,758
Posted By rdrtx1
while read tableName do echo "exec...
while read tableName
do
echo "exec dbms_stats.gather_table_stats(ownname => 'SIEBEL', tabname => <tableName in Single Quotes> ,degree => 3, cascade => true );" | sed 's/<tableName in Single...
Showing results 1 to 25 of 135

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