Search Results

Search: Posts Made By: Ygor
1,737
Posted By Ygor
Try...diff file[12].csv | awk -F '_|,'...
Try...diff file[12].csv | awk -F '_|,' '{a[$2]=$0;b[$2]++}END{for(i in a)if(b[i]==1)print a[i]}'
47,115
Posted By Ygor
The Advanced Bash-Scripting Guide has some...
The Advanced Bash-Scripting Guide has some exercises (http://www.tldp.org/LDP/abs/html/exercises.html).
18,785
Posted By Ygor
To execute the block, you need to have a slash /...
To execute the block, you need to have a slash / on a line of its own, after the END; line.
3,211
Posted By Ygor
Try something like...$ string1='3X' $ case...
Try something like...$ string1='3X'

$ case $string1 in [0-9][0-9]) : ;; [0-9]?) string1=${string1:0:1} ;; esac

$ echo $string1
3

$
5,466
Posted By Ygor
Try converting the txt file to dos format, via...
Try converting the txt file to dos format, via unix2dos or similar, before using uuencode.
2,184
Posted By Ygor
Try...$ cat file1 Tom|london Tom|london ...
Try...$ cat file1
Tom|london
Tom|london
Tom|Paris
Adam|Madrid
Adam|NY
Tom|amsterdam
Tom|amsterdam
Tom|amsterdam
Tom|amsterdam

$ awk -F'|'...
Forum: Linux 08-07-2013
5,891
Posted By Ygor
I think the question has already been answered,...
I think the question has already been answered, but to reduce confusion, perhaps include the time zone %Z to see what is happening...
$ date --date "1979-10-26" '+%Y%m%d%H %Z'
1979102600 GMTDT

$...
12,820
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
Forum: What is on Your Mind? 03-20-2013
7,037
Posted By Ygor
I agree that it's difficult to help people when...
I agree that it's difficult to help people when it's difficult to grok the lingo.
29,329
Posted By Ygor
try cut
try cut
22,357
Posted By Ygor
sendmail is usually in /usr/sbin and not on the...
sendmail is usually in /usr/sbin and not on the normal path
4,650
Posted By Ygor
The script seems fine to me. Try running it with...
The script seems fine to me. Try running it with -x option, as in: sh -x scriptname
22,357
Posted By Ygor
Some possible solutions in this thread... ...
Some possible solutions in this thread...
https://www.unix.com/unix-advanced-expert-users/14177-unable-sent-mail-html-format-mailx-command.html
4,236
Posted By Ygor
Works fine for me. What system are you on? Do you...
Works fine for me. What system are you on? Do you have nawk or gawk?
4,236
Posted By Ygor
Try...awk ' NR == 1 { from = $2 ...
Try...awk ' NR == 1 {
from = $2
"date -u +%Y%m%d" | getline to
$NF = to
}
NR == 2 {
"expr $(date -d " to " +%s) - $(date -d "...
Forum: Linux 10-08-2012
3,473
Posted By Ygor
Try...awk '$3=="sil"{if(p)print...
Try...awk '$3=="sil"{if(p)print p,$1,w;w="";getline;p=$1}{w=w $3}' file
12,181
Posted By Ygor
I thought that file ownership is just a user ID...
I thought that file ownership is just a user ID number, which you can see using ls -ln
1,018
Posted By Ygor
Try...awk 'c<$1{while(c<$1-1)print ++c,0}{print...
Try...awk 'c<$1{while(c<$1-1)print ++c,0}{print c=$1,1}' c=-1 file1
2,761
Posted By Ygor
Try...$ n='1-3,6,7,9-11' $ seq 1 14|paste...
Try...$ n='1-3,6,7,9-11'

$ seq 1 14|paste -s|cut -f "$n"|tr '\t' ' '
1 2 3 6 7 9 10 11

$
2,589
Posted By Ygor
See... https://www.unix.com/302098992-post2.html
See... https://www.unix.com/302098992-post2.html
3,796
Posted By Ygor
I would guess that it depends on how you remove...
I would guess that it depends on how you remove the top lines. This is at the bash prompt...$ echo x > file1

$ ( ( echo a ; sleep 30 ; echo b ) | tee -a file1 ) &
[1] 7000

$ a


$ sed -i 1d...
Forum: Programming 09-20-2012
2,693
Posted By Ygor
Save it as a CSV file and define it as an...
Save it as a CSV file and define it as an external table.
25,124
Posted By Ygor
Using awk...$ rand=$(awk...
Using awk...$ rand=$(awk 'BEGIN{srand();for(i=1;i<=32;i++)printf "%x", int(rand()*16)}')

$ echo $rand
b9645ca2f0c5f55ed1411258d57b5bb5

$
4,868
Posted By Ygor
Using your solution and tac...$ cat test.txt ...
Using your solution and tac...$ cat test.txt
TEST
JOHN
ADAM
MICHAEL
SEBASTIAN
ANDY

$ tac test.txt | sed '/MICHAEL/,+2d' | tac
TEST
SEBASTIAN
ANDY

$
1,461
Posted By Ygor
Oh I see the problem. $1 and $2 are local to...
Oh I see the problem. $1 and $2 are local to functions but you are not passing parameters to the function. Perhaps define a and b outside of the functions, e.g...$ cat sh.1
menu ()
{
echo...
Showing results 1 to 25 of 500

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