Search Results

Search: Posts Made By: DeCoTwc
120,303
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 ~...
1,314
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[@]} ;...
6,125
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 <...
3,327
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...
17,535
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)...
4,074
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,580
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...
3,555
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...
Showing results 1 to 8 of 8

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