Tagged Questions
3
votes
2answers
34 views
Automated partition selection in bash script
I'm trying to write a bash script to run from Linux on a CD or flashdrive that can mount Windows and change stuff, but I don't know how to go about detecting which partition/drive is Windows.
My best ...
2
votes
2answers
52 views
Using bash shell function inside AWK
Is it possible to use bash function inside AWK somehow?
Example file (string, int, int, int)
Mike 247808 247809 247810
Trying to convert values from decimal to hexadecimal.
Function defined ...
3
votes
1answer
90 views
Pass colors from ls through pipe to awk 'print' statement
This is a follow-up to my question from yesterday, Show sum of file sizes in directory listing.
Thanks to Zero Piraeus and a point in the right direction by Mauritz Hansen, I now have
function ...
5
votes
4answers
107 views
Show sum of file sizes in directory listing
The Windows dir directory listing command has a line at the end showing the total amount of space taken up by the files listed. For example, dir *.exe shows all the .exe files in the current ...
1
vote
1answer
44 views
Safely convert unicode strings to printable characters
I have many HTML files containing mixed unicode strings like \303\243 and printable characters like %s. What I'd like to do is converting the unicode strings into printable characters in a safe way.
...
1
vote
2answers
40 views
How do I get a field in bash's job list using awk?
I wanted to write a function to retrieve a field from the list of background jobs in bash. For example to get a specific argument.
Let's say I send vim to the background, so "jobs" displays this ...
2
votes
3answers
132 views
Bash commands/script to remove a line from CSV with duplicate in column
I have a lot CSV files that I have combined. However, there are duplicates, but the entire line is not duplicated. I do have a column that I want to use as the criteria to search for a duplicate. ...
1
vote
0answers
126 views
Processing shell script options with awk
I'm looking for way to process shell script arguments that is cleaner and more "self documenting" than getopt/getopts.
It would need to provide...
Full support of long options with or without a ...
1
vote
0answers
117 views
Conky - string formatting
I have conky the record:
${color lightblue} Down: ${downspeed wlan0} Up: ${upspeed wlan0}
Conky prints link speed, but the text moves:
Down: OB Up: OB
Down: 60B Up: 60B
Down: 148B Up: 148B
...
1
vote
1answer
253 views
Validate Unix Timestamp using BASH
My google-fu has failed me so I'm hoping someone here can point me in the right direction. I'm in the middle of doing some data validation efforts and I suspect the system is recording some invalid ...
2
votes
1answer
339 views
Bash variable in Awk script
I have this flat file database(ff_servers.db) with following contents:
192.168.154.2 Alaska hp
192.168.157.3 Colorado dell
192.168.156.3 hawaii hp
From command line, I could run:
awk ...
1
vote
1answer
80 views
how to add a description in footer
I enjoy learning how to modify files with awk, sed, and bash. However, I know it could cause issues down the road and I would like to be prepared with a log inside the file. I was thinking about how ...
2
votes
3answers
264 views
Awk to output read file
I havent stepped into awk yet but it is on my plate for learning this coming year. I asked a previous question that led me to awk and it works. However, I am unsure how to input all file types and ...
1
vote
3answers
490 views
Print lines where first field has only four characters using regex in awk?
John Goldenrod:(916) 348-4278:250:100:175
Chet Main:(510) 548-5258:50:95:135
Tom Savage:(408) 926-3456:250:168:200
Elizabeth Stachelin:(916) 440-1763:175:75:300
output should contain the lines ...
1
vote
1answer
105 views
renaming diverse files
I store files named like this: word-word2-word3-word4.txt . The number of "words" varies from file to file.
I want to replace certain of the dashes with pluses e.g word+word2-word3+word4.txt
I want ...