Search Results

Search: Posts Made By: graysky
1,812
Posted By graysky
Thanks for the reply. It turns out that the...
Thanks for the reply. It turns out that the problem was more complex than I indicated due to the need to sort and group like entries. To illustrate, take the example I provided above: the two...
1,812
Posted By graysky
Convert tab separated text to non-trivial xml. (pwsafe --> KeePassx)
I'd like to take the output of `pwsafe --exportdb > database.txt` and convert it to a KeePassX XML friendly format (feature request in pwsafe (https://github.com/nsd20463/pwsafe/issues/3)).

I...
10,092
Posted By graysky
Edited. Didn't know pastebin was taboo here nor...
Edited. Didn't know pastebin was taboo here nor did I know that I could upload attachments.



Thanks for the post. Here is an elegant solution:
grep -E -o '\<[0-9]{1,2}\.[0-9]{2,5}\>' file
10,092
Posted By graysky
grep -E -o '\<[0-9]{1,2}\.[0-9]{2,5}\>' file
grep -E -o '\<[0-9]{1,2}\.[0-9]{2,5}\>' file
10,092
Posted By graysky
Need to extract only decimal numbers for a glob of text [SOLVED]
If you have a look at this thread (https://bbs.archlinux.org/viewtopic.php?id=136971), you'll see that users have been posting the output a script which are numbers that range from 2 to 5 decimal...
4,937
Posted By graysky
Possible to use /usr/bin/watch to call a function?
I want to have a script both define functions and have the ability to run an external program calling one of them. This is the simplified construct:



#!/bin/bash
foo() {
echo "this is foo"...
2,239
Posted By graysky
Thanks! I actually found the solution myself...
Thanks! I actually found the solution myself (choice of key words is critical to success) in this old thread (https://www.unix.com/shell-programming-scripting/13943-print-variable-awk.html).


for...
2,239
Posted By graysky
[awk] - how to insert an external variable [solved]
I want to incorporate the variable in the for statement as a column of my processed file. In the INCORRECT example below, it is $i which corresponds to the i in my for loop:


for i in x86_64...
1,547
Posted By graysky
simple sed question - replace from phrase to end of line
I have the following line an in input file I want to digest with sed and simple replace the bold part with a variable defined in my bash script. I can do this in several sed operations but I know...
1,342
Posted By graysky
[SOLVED] for loop to process files
I need to process a dirtree containing ms office files such that each file is stored as a variable and also, just the file file stem. Why? They will be using as input and output parameters for...
1,425
Posted By graysky
Nice, thanks for the tip with awk! ...how...
Nice, thanks for the tip with awk!

...how can I do it my way, that is get the output to display with non-printing characters such as tabs and linefeeds? I know this can be done; I did it years...
1,425
Posted By graysky
parsing simple output help needed
Goal: for each hostname (mars, phobos, and deimos grab the value of state = in a variable so I work on it further.

I figured I'll need to use sed to find the target host name, then substitute the...
22,702
Posted By graysky
Not quite what the op asked about, but it's...
Not quite what the op asked about, but it's pretty darn good. Vidar’s Blog Multithreading for performance in shell scripts (http://www.vidarholen.net/contents/blog/?p=9) AUR (en) - multilame...
5,281
Posted By graysky
Thanks for the replies, all. I like chakrapani's...
Thanks for the replies, all. I like chakrapani's code the best because it's only two lines :)
5,281
Posted By graysky
Picking high and low variables in a bash script - possible?
Is it possible to have a bash script pick the highest and lowest values of four variables? I've been googling for this but haven't come up with anything. I have a script that assigns variables...
10,063
Posted By graysky
My distro doesn't have iostat :) I need to...
My distro doesn't have iostat :) I need to figure out which package contains it.
10,063
Posted By graysky
Help with bash script - Need to get CPU usage as a percentage
I'm writing a bash script to log some selections from a sensors output (core temp, mb temp, etc.) and I would also like to have the current cpu usage as a percentage. I have no idea how to go about...
30,717
Posted By graysky
I figured I could just have it run 'mount | grep...
I figured I could just have it run 'mount | grep 192.168' and then check to see if that is present. I don't know how to pipe the output of that into a variable though.
30,717
Posted By graysky
bash script to check if mounted, and mount if not
I'd like to make a wrapper bash script that will make sure that an nfs mount is mounted before launching a program that depends on the mount being active. Basically:

1) Check to see if the mount...
20,485
Posted By graysky
Cool, thanks for all the replies, all!
Cool, thanks for all the replies, all!
20,485
Posted By graysky
bash script quesiton - if any file exists then ...
I'd like a bash script to simply check to see if any file/files are present in a source directory, and if so move it/them to a target directory.

I have this but it doesn't work:

#!/bin/bash
...
7,294
Posted By graysky
Yeah, got that error here as well... :(
Yeah, got that error here as well... :(
7,294
Posted By graysky
thanks chat - I'll give it a try!
thanks chat - I'll give it a try!
7,294
Posted By graysky
@Ikon - I tried your code out (very elegant by...
@Ikon - I tried your code out (very elegant by the way), but I'd like it to quit upon a successful answer. In other words, if the user selects on of the choices, it'll do the action, then quit.
7,294
Posted By graysky
@ajp - very cool, this is exactly what I wanted,...
@ajp - very cool, this is exactly what I wanted, thank you. One question though.. can I add an if statement that will start over is the user types an unidentified key (in other words, a key that...
Showing results 1 to 25 of 26

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