Search Results

Search: Posts Made By: tukuyomi
766
Posted By Scrutinizer
Try: Zet=$(wc -l <...
Try:
Zet=$(wc -l < /home/$USER/Desktop/14tilt.txt)
Ted=$(wc -c < /home/$USER/Desktop/14tilt.txt)

Then you should not need the cut commands either...
1,895
Posted By Scrutinizer
How about something like: while read script1 &&...
How about something like:
while read script1 && read script2 <&3
do
"$script1" &
"$script2" &
wait
done < script1.txt 3<script2.txt


Variable script1 is read from file descriptor 0...
5,274
Posted By RudiC
Try also awk '!/no hit/' RS= ORS="\n\n"...
Try also awk '!/no hit/' RS= ORS="\n\n" file
5,366
Posted By Corona688
tr does not work that way. It deals with...
tr does not work that way. It deals with individual characters, not strings. Since you gave it two characters on the input, it's expecting 2 characters on the output, too.

This should work:
...
Forum: Red Hat 05-19-2013
1,669
Posted By Don Cragun
The standards say that the type time_t is an...
The standards say that the type time_t is an integral type. They don't specify whether the type is signed or unsigned. On systems with a signed 64-bit time_t, any time from the big bang to the...
2,430
Posted By Don Cragun
There was a major difference in the behavior of...
There was a major difference in the behavior of the echo utility (or shell built-in) between 4.2BSD (from the University of California, Berkeley) and UNIX System V (from AT&T Bell Laboratories). In...
907
Posted By ctsgnb
awk -F= '{x=$1;$1=z;gsub(OFS,RS x FS)}1' yourfile
awk -F= '{x=$1;$1=z;gsub(OFS,RS x FS)}1' yourfile
11,727
Posted By Scrutinizer
@tukuyomi: $ cat test.sh echo "\$# \"$#\"" ...
@tukuyomi:
$ cat test.sh
echo "\$# \"$#\""
echo "\$1 \"$1\""
echo "\$2 \"$2\""
if [ "$1" = '' ]; then
echo no arguments given
fi

$ ./test.sh
$# "0"
$1 ""
$2 ""
no arguments given
...
11,097
Posted By Corona688
Read user input from /dev/tty, to avoid...
Read user input from /dev/tty, to avoid accidentally reading input from the pipe or file instead. /dev/tty will always be the current terminal, if any.

... | while read LINE
do
printf...
989
Posted By Scrutinizer
for ((i=1; i<=65535; i++)); do printf...
for ((i=1; i<=65535; i++)); do
printf "%04X\n" "$i"
done

Posix:
i=0
while [ $i -le 65534 ] ; do
printf "%04X\n" "$((i+=1))"
done
967
Posted By locoroco
I have found the solution for bash: mogrify...
I have found the solution for bash:
mogrify -resize x120 *.jpg

Mogrify is a part of ImageMagick
1,604
Posted By
perl -pe 's/\s(SNAG|MARC|EA|ER)/\n$1/g' file.in >...
perl -pe 's/\s(SNAG|MARC|EA|ER)/\n$1/g' file.in > file.out
1,200
Posted By Corona688
-n is closer to what you want, but a lot of that...
-n is closer to what you want, but a lot of that pipe chaining in backticks is pointless since you know the PID. Just watch if /proc/pid still exists, each running process gets a directory inside...
3,962
Posted By alister
You don't really need the non-portable -r option...
You don't really need the non-portable -r option for that sed task. To avoid -r, simply use the equivalent basic regular expression syntax by backslash-escaping the parentheses.

Regards,
Alister
1,112
Posted By Chubler_XL
$ grep -f f1 f2 1|d 2|e 3|f 4|g 5|h ...
$ grep -f f1 f2
1|d
2|e
3|f
4|g
5|h


or
$ awk -F\| 'NR==FNR{A[$1]++;next} A[$1]' f1 f2

or
awk -F\| 'NR==FNR{A[$1]=$0;next} $1 in A { print A[$1] }' f2 f1
2,166
Posted By Scrutinizer
awk -F\| 'A[$1]++==1' f1 f2
awk -F\| 'A[$1]++==1' f1 f2
2,230
Posted By alister
sed 'h; s/=.*/=/; x; s/^[^=]*=//;...
sed 'h; s/=.*/=/; x; s/^[^=]*=//; s/change/different/g; H; g; s/\n//'


Sample run:

$ cat data
somechangeVariable1=Something I would like to change something
somechangeVariable2=Something...
Showing results 1 to 17 of 17

 

Featured Tech Videos

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