Search Results

Search: Posts Made By: tukuyomi
1,505
Posted By tukuyomi
Get ideas from this example : echo...
Get ideas from this example :
echo "abcdefghij;klmnop;qrstuv;wxyz" | tr ';' '\n' | sort | uniq | awk 'length()<8' | tr '\n' ';'
2,041
Posted By tukuyomi
How is it possible to have plenty of files with...
How is it possible to have plenty of files with the same name in one directory?
Do you mean instead «All files ending with "snps.ivg"» or «All "snps.ivg" in all sub-directories»?
Thanks for...
6,648
Posted By tukuyomi
With GNU date, you can do something like this, in...
With GNU date, you can do something like this, in sh or bash:
#!/bin/sh

# Past date in seconds since Epoch
past=$(date +%s --date "12/02/2013 11:21")

# Now in seconds since Epoch
now=$(date...
1,628
Posted By tukuyomi
Just to be clear : input_file's 7th column is...
Just to be clear : input_file's 7th column is what you call 'item list', isn't it?
Do you also mean that you might have aa1 as well as foo, bar, and etc entries only for $7? ab2, fool, bars, etcs...
1,628
Posted By tukuyomi
Nothing fancy in the below script, just an...
Nothing fancy in the below script, just an all-in-one task:
awk '{$10=$7;$7=$8=$9="na"}
$10~/aa1/{$7="aa1"}
$10~/ab2/{$8="ab2"}
$10~/ac3/{$9="ac3"}
1' input_file > output_file
5,660
Posted By tukuyomi
awk '$0=i+=5" "$0' file(not tested, I'm on my...
awk '$0=i+=5" "$0' file(not tested, I'm on my phone)
1,449
Posted By tukuyomi
Try this one instead : awk -F, '{A[$1 FS $2] =...
Try this one instead :
awk -F, '{A[$1 FS $2] = A[$1 FS $2] ? A[$1 FS $2] FS $NF : $N} END {for ( k in A ) print A[k]}' output/* > output-4.csv
1,532
Posted By tukuyomi
Try also this awk code as well :awk...
Try also this awk code as well :awk 'NR==FNR{A[++i,1]=$1;A[i,2]=$2;A[i,3]=$3;next}
{j=0;while(j++<i)if(($2==A[j,1])&&($3>=A[j,2])&&($3<=A[j,3]))print}
' filterfile datafile
1,532
Posted By tukuyomi
Edit - Nevermind, don't pay attention to this...
Edit - Nevermind, don't pay attention to this stupid question.


Is it acceptable to use a range file like this?
2,491
Posted By tukuyomi
EDIT : The solution below does not fit the...
EDIT : The solution below does not fit the question, sorry about that :X

Is this OK?~/unix.com$ awk 'BEGIN{n=4; for(i=1; i<=n; i++)print i}'
1
2
3
4
~/unix.com$ awk 'BEGIN{n=4;...
2,090
Posted By tukuyomi
Actually, Scrutinizer's reply is way more simple...
Actually, Scrutinizer's reply is way more simple to use :)
if ! $SERVICE status > /dev/null 2>&1uses exit status as well; in this case if $SERVICE status did not (!) exit with status 0; then rest of...
2,090
Posted By tukuyomi
if [ "$SERVICE status" = 'xinetd is stopped' ] ...
if [ "$SERVICE status" = 'xinetd is stopped' ]
In this case, "$SERVICE status" is equal to "/etc/init.d/xinetd status", not 'xinetd is stopped'

I suggest you to use exit code instead of what is...
11,394
Posted By tukuyomi
Wow! :D It took me some time to figure out what...
Wow! :D It took me some time to figure out what was going on in this tiny script ^^
6,111
Posted By tukuyomi
Thanks Corona688 for your input ! Here is...
Thanks Corona688 for your input !
Here is another solution using AWK:
~/unix.com$ awk '{gsub("\r","");print > "file"$NF".txt"}' RAW
6,111
Posted By tukuyomi
I suspect your RAW file to have \r\n at the end...
I suspect your RAW file to have \r\n at the end of each line (typically all txt files created from MS Windows notepad). You have to remove \r from the original file. Try (not tested)
tr '\r\n' '\n'...
6,111
Posted By tukuyomi
awk '{print > "file"$NF".txt"}'...
awk '{print > "file"$NF".txt"}' RAW
6,111
Posted By tukuyomi
awk '{print > $3".txt"}' EDIT.txt awk...
awk '{print > $3".txt"}' EDIT.txt

awk '{print > $NF".txt"}' RAW
1,495
Posted By tukuyomi
Actual Debian Testing (Jessie) also uses gawk...
Actual Debian Testing (Jessie) also uses gawk after a "standard system" install.
You still get mawk if you choose to not install the "Standard system" at Tasksel install step.
3,238
Posted By tukuyomi
The external command seq 24 might come in handy.
The external command seq 24 might come in handy.
Forum: Red Hat 05-18-2013
1,896
Posted By tukuyomi
Any value between 0 and $(date +%s) can be an...
Any value between 0 and $(date +%s) can be an epoch value
Forum: UNIX and Linux Applications 04-13-2013
2,650
Posted By tukuyomi
Try this link: Index of...
Try this link:
Index of /pub/mozilla.org/firefox/releases/19.0.2 (http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/19.0.2/)
2,534
Posted By tukuyomi
Give this one go,...
Give this one go, https://www.unix.com/302107299-post2.html
It worked fine with /bin/sh and /bin/bash on Debian Testing
2,053
Posted By tukuyomi
man bash (or any shell that supports getopts) and...
man bash (or any shell that supports getopts) and find the getopts function
2,456
Posted By tukuyomi
You can try using the rsync delete options, but...
You can try using the rsync delete options, but you have to be very careful with these.
--del an alias for --delete-during
--delete delete...
4,303
Posted By tukuyomi
Quite the same solution as Corona688; uses aplay...
Quite the same solution as Corona688; uses aplay to play wav files:
#!/bin/sh

while read line; do
set -- $line
while [ "$1" ]; do
echo aplay "$1.wav" # remove echo to actually let aplay...
Showing results 1 to 25 of 312

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