Search Results

Search: Posts Made By: midhun19
866
Posted By Scrutinizer
Try: (./child.ksh >/dev/null) &
Try:
(./child.ksh >/dev/null) &
4,149
Posted By vbe
If its invoking multiple children then its own...
If its invoking multiple children then its own PID should be the common PPID of all children...
e.g. here I know I opened all my windows from one, I look for the first and ps grep its PID:
...
18,143
Posted By vgersh99
pattern_str="1,jobname1" awk -F, -v...
pattern_str="1,jobname1"
awk -F, -v td=$temp_date -v pattern_str="${pattern_str}" '$0 ~ pattern_str {$3="completed";$5=td} 1' OFS="," file
18,143
Posted By krishmaths
You need to use awk variable like this: ...
You need to use awk variable like this:


awk -F, -v td=$temp_date '/1,jobname1/ {$3="completed";$5=td} 1' OFS="," file
18,143
Posted By krishmaths
awk -F, 'BEGIN{"date +\"%Y%m%d%H%M%S\""|getline...
awk -F, 'BEGIN{"date +\"%Y%m%d%H%M%S\""|getline d} /1,jobname1/{$3="completed";$5=d} 1' filename
18,143
Posted By krishmaths
awk -F, '/1,jobname1,in_progress/...
awk -F, '/1,jobname1,in_progress/ {$3="completed"} 1' filename
1,436
Posted By Jotne
You did remove this OFS=","
You did remove this OFS=","
1,436
Posted By RudiC
Try (untested): awk -F, '{$2=$2 FS...
Try (untested): awk -F, '{$2=$2 FS "status,starttime"} 1' OFS="," file
24,054
Posted By elixir_sinari
expr \( $total_size + $file_size \) / 1024 ...
expr \( $total_size + $file_size \) / 1024
Parentheses are special for the shell. So, you need to escape them.
Also note the whitespace introduced between the parenthesis (both opening and closing)...
24,054
Posted By Don Cragun
With a recent Korn shell (newer than 1988): ...
With a recent Korn shell (newer than 1988):
total_size=$(( (total_size + file_size) / 1024 ))if you want integer arithmetic or:
total_size=$(( (total_size + file_size) / 1024. ))if you want...
1,072
Posted By itkamaraj
use double quotes echo...
use double quotes


echo "$string"
25,407
Posted By alister
In order to preserve the tabs, you must...
In order to preserve the tabs, you must double-quote $line.

Simplest solution is to do the splitting with the read statement:
IFS=$'\t' read name age address

If your shell doesn't support that...
24,403
Posted By Skrynesaver
Windows uses \r\n as \ line break whereas Unix...
Windows uses \r\n as \ line break whereas Unix uses \n. You can pre-filter file like so:

sed 's/$/\r/' <samplefile.txt >sampleflie.win.txt
24,403
Posted By Skrynesaver
If your sed doesn't recognise carriage return \r...
If your sed doesn't recognise carriage return \r use a tool that does

perl -pi.bak -e 's/$/\r/' path/to/file
1,565
Posted By elixir_sinari
It means a pattern which has the value of "par1"...
It means a pattern which has the value of "par1" followed by 0 or more spaces and 0 or more characters which are not space...
1,565
Posted By elixir_sinari
If I understand your requirement properly, try ...
If I understand your requirement properly, try

sed "s|$par1[ ]*[^ ]*|$parval|" sample_file


.* expression will always match the longest possible pattern...need to restrict the matched pattern.
1,785
Posted By tukuyomi
AFAICT, s and b do not need extra arguments, do...
AFAICT, s and b do not need extra arguments, do they?
I would replace this command:
while getopts j:s:b:e: opt; do to while getopts j:sbe: opt; do

Also, try this, for debugging purpose:
s)...
4,699
Posted By guruprasadpr
Hi You can get this in perl: $ echo...
Hi
You can get this in perl:


$ echo "abc efg" | perl -ne 'print s/abc/ABC/; '
1


Substitution in perl returns the number of substitutions made. If none, it will not throw any result.
...
1,102
Posted By balajesuri
sed '6,$s/<pattern>/<replace_string>/g'...
sed '6,$s/<pattern>/<replace_string>/g' inputfile
1,912
Posted By elixir_sinari
The shell will not look at your date command...
The shell will not look at your date command which you've protected using single-quotes...

Try this

sed "s/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$/`date +"%Y-%m-%d"`/g" e123
1,912
Posted By Scrutinizer
Check if your input file is in DOS format, it...
Check if your input file is in DOS format, it should be in Unix format.
1,912
Posted By balajesuri
sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$/'`date...
sed 's/[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}$/'`date +"%Y-%m-%d"`'/g' sample.txt
Showing results 1 to 22 of 22

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