Search Results

Search: Posts Made By: akshu.agni
4,206
Posted By MadeInGermany
Even better with the [ ] in quotes! And in case...
Even better with the [ ] in quotes!
And in case the dot is a real dot, this one should be the one in [ ]
ps axo pcpu,pid,ppid,user,state,vsz,etime,args | grep "DSD[.]RUN"
ps -eo...
4,206
Posted By bakunin
As i told you in the last post, this: ps axo...
As i told you in the last post, this:

ps axo pcpu,pid,ppid,user,state,vsz,etime,args | grep [D]SD.RUN

Would do the same with one program call less.

I hope this helps.

bakunin
4,206
Posted By bakunin
instead of ... | grep program | grep -v...
instead of

... | grep program | grep -v grep

better use

... | grep [p]rogram

which saves one "grep".

for the "%CPU" have a look at the man-page of the ps-command. The "-o"-option is...
4,206
Posted By jim mcnamara
I think this may be what you see - From...
I think this may be what you see -
From man7.org ps(1) - Linux manual page (http://man7.org/linux/man-pages/man1/ps.1.html)

Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX
...
2,262
Posted By Corona688
Do you mean "replace it with null" as in replace...
Do you mean "replace it with null" as in replace it with ASCII null, or "replace it with null" as in delete it?

Either's possible with tr.

# Delete
tr -d '[\177-\377]' < input > output
#...
20,463
Posted By gprashant
Hi, Try this: sed -i '1s/.*/...
Hi,

Try this:
sed -i '1s/.*/ HEADER20110101&/' a.txt
1,929
Posted By ltomuno
echo '2011-01-01 00:00:00' | sed -n 's/[-|...
echo '2011-01-01 00:00:00' | sed -n 's/[-| |:]//gp'
1,929
Posted By hergp
Try $ echo "2011-01-01 00:00:00" | sed 's/[...
Try

$ echo "2011-01-01 00:00:00" | sed 's/[ :-]//g'
20110101000000
1,929
Posted By itkamaraj
Is your's gnu date ? try whether the below...
Is your's gnu date ?

try whether the below command works or not

date -d "1 day ago" +%Y%m%d
20,463
Posted By michaelrozar17
Alternate awk.. awk 'NR==1{$0="header\n"$0}1'...
Alternate awk..
awk 'NR==1{$0="header\n"$0}1' inputfile
20,463
Posted By itkamaraj
i am adding 123 in the first line of the file...
i am adding 123 in the first line of the file called test


$ nawk ' { if (NR==1){printf("123%s\n",$0)} else {print} }' test
123abc
abc
abc
abc
abc

$ cat test
abc
abc
abc
abc
abc
...
2,176
Posted By ctsgnb
sed "s/ = /=/;s/'/\\\'/g" infile# cat tst XX =...
sed "s/ = /=/;s/'/\\\'/g" infile# cat tst
XX = to_date ('9999-12-31 23:59:59', 'YYYY-MM-DD HH24:MI:SS')
# sed "s/ = /=/;s/'/\\\'/g" tst
XX=to_date (\'9999-12-31 23:59:59\', \'YYYY-MM-DD...
2,176
Posted By metal005
XX= echo $XX|sed 's/*situation now*/*what you...
XX= echo $XX|sed 's/*situation now*/*what you want*/'


would probably work
748
Posted By Shell_Life
See if this works for you: #!/usr/bin/ksh ...
See if this works for you:
#!/usr/bin/ksh
typeset -i mFirst5
typeset -i mLast5

mFirstLine=$(head -1 inp_file)
mFirst14=$(echo ${mFirstLine} | cut -d'|' -f1-4)
mFirst5=$(echo ${mFirstLine} |...
1,129
Posted By kurumi
ruby -ne 'print if /^[DH]/' file
ruby -ne 'print if /^[DH]/' file
1,129
Posted By kevintse
echo "DATA" | grep "^[DH]"
echo "DATA" | grep "^[DH]"
1,129
Posted By DGPickett
grep command pattern for lines that begin with D...
grep command pattern for lines that begin with D or H:
$ grep '^[DH]' inf_files >out_file
998
Posted By ctsgnb
in Korn shell (#!/bin/ksh) , you can use if...
in Korn shell (#!/bin/ksh) , you can use if condition with the operators

-ot|older than
-nt|newer thanon files

Example :

# touch titi
# touch toto
# stat titi
File: `titi'
Size: 0 ...
1,086
Posted By ctsgnb
if running linux : ls -m input---------- Post...
if running linux :
ls -m input---------- Post updated at 12:22 PM ---------- Previous update was at 12:13 PM ----------

or
ls -m input | tr -d ' '
1,086
Posted By sk1418
ls |tr '\n' ',' ?
ls |tr '\n' ','

?
870
Posted By panyam
file_name=$1 ds=`echo "$file_name" | awk...
file_name=$1
ds=`echo "$file_name" | awk -F"[_.]" '{ print "HDR"$3$4}'`

if [ -f "$file_name" ] ; then
fds=`head -1 "${file_name}"`
if [ "${fds}" = "${ds}" ];then
echo "successful"
else
echo...
870
Posted By fpmurphy
#!/bin/bash FNAMESTUB=NGC_DATA ...
#!/bin/bash

FNAMESTUB=NGC_DATA
DATESTR=20110310
HEADER=111

FNAME="${FNAMESTUB}_${DATESTR}_${HEADER}.txt"

if [[ -f $FNAME ]]
then
FIRSTLINE=$(head -1 ${FNAME} )
if [[ "$FIRSTLINE"...
Showing results 1 to 22 of 22

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