Search Results

Search: Posts Made By: DeCoTwc
884
Posted By DeCoTwc
I believe below will get you what you're looking...
I believe below will get you what you're looking for.

d@AirBox:~$ v1=($(awk -F\: '{print $1}' file))
d@AirBox:~$ v2=($(awk -F\: '{print $2}' file))
d@AirBox:~$ for ((i=0 ; i < ${#v1[@]} ;...
3,538
Posted By DeCoTwc
Someone already posted a very elegant awk...
Someone already posted a very elegant awk solution, so this is just because I like trying to solve things in pure shell.

i=1;while read -a line;do line[4]=$i;echo "${line[@]}";let i=i+1;done <...
2,286
Posted By DeCoTwc
Only because I can't sleep... lsvg -o |...
Only because I can't sleep...


lsvg -o | while read VG
do
lsvg -l $VG | while read -a x
do
case "${x[6]}" in
(closed)
echo $VG ${x[5]} Closed
;;
(*)
echo $VG...
13,429
Posted By DeCoTwc
I'm not quite sure what the issue you're having...
I'm not quite sure what the issue you're having is. It seems the solution Bartus posted should work. For funsies though, you could probably do it like this:

(19:12:02\[root@DeCoBoxOmega)...
2,932
Posted By DeCoTwc
Depending on what you're trying to do, this could...
Depending on what you're trying to do, this could be a good use for lock files. There's a bunch of different ways you could do it. But based on the simplicity of your example, the easiest way would...
2,300
Posted By DeCoTwc
(08:28:29\[D@DeCoWork15) [~]$ data_size=$(ls...
(08:28:29\[D@DeCoWork15)
[~]$ data_size=$(ls -lS | grep -v "total" | head -1 | awk '{ print $5 }')

(08:28:37\[D@DeCoWork15)
[~]$ echo $data_size
6671723580


Just put the closing parentheses...
2,775
Posted By DeCoTwc
Well I'll be a son of a something else...fixed...
Well I'll be a son of a something else...fixed it.

(01:18:49\[D@DeCoBox15)
[~]$ ./mysolution input > my_results

(01:19:05\[D@DeCoBox15)
[~]$ sdiff expected_results my_results
Joe Smith...
106,667
Posted By DeCoTwc
d@DeCobox-Micro ~ $ cat unix need, to,...
d@DeCobox-Micro ~
$ cat unix
need, to, break, this, line, into, individual, lines

$ cat unix |sed 's/\,/\n/g'
need
to
break
this
line
into
individual
lines

d@DeCobox-Micro ~...
Showing results 1 to 8 of 8

 

Featured Tech Videos

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