Search found 934 matches
- Sat 17 Feb 2018, 17:25
- Forum: Programming
- Topic: Use rev command to get name of mounted share
- Replies: 11
- Views: 2800
When I tested df | awk '{ print $NF }' I discovered that it outputs a column of fields rather than the last field The solution was to use the 'echo' command. echo `df` | awk '{ print $NF }' Now I get the share folder /root/network/GOLD-XP-2016-SharedDocs __________________________________________ Y...
- Sun 31 Dec 2017, 22:18
- Forum: Programming
- Topic: Inject a wav file in to a bash script
- Replies: 12
- Views: 2936
Here's another way using tail.
Cheers,
s
Code: Select all
#!/bin/bash
#chime.wav
#cat header chime.wav > hourlychime.sh ; chmod +x hourlychime.sh
hours=`date +"%-l"`
size=`stat -c %s chime.wav`
for (( i=1; i <= $hours; i++ )); do tail -c $size hourlychime.sh | aplay; done
exit;
s
- Mon 23 Jan 2017, 01:32
- Forum: Programming
- Topic: YAD - Tips
- Replies: 837
- Views: 336918
- Thu 19 Jan 2017, 00:34
- Forum: Programming
- Topic: GtkDialog - tips
- Replies: 1504
- Views: 911878
selection of tree items
@mavrothal, AFAIK, a widget can have only one associated variable. So a single tree with TREE1 and TREE2 variables isn't possible. @MochiMoppel, thanks for catching my typo! Fixed. Perhaps this also might be useful. # get fields from a tree selection # example file echo 'name1 | cat1 | desc1 | repo...
- Wed 11 Jan 2017, 14:35
- Forum: Cutting edge
- Topic: aufs specific snapmergepuppy
- Replies: 10
- Views: 4844
- Tue 10 Jan 2017, 16:37
- Forum: Cutting edge
- Topic: aufs specific snapmergepuppy
- Replies: 10
- Views: 4844
- Mon 26 Sep 2016, 22:04
- Forum: Programming
- Topic: Converting 12 digits number to 6 digits number and reverse?
- Replies: 35
- Views: 7192
Perhaps this will do.. if.....
#RRGGBB = (8 bits each)
#RRRRGGGGBBBB = (16 bits each)
then-
pick first two of each group
Cheers,
s
#RRGGBB = (8 bits each)
#RRRRGGGGBBBB = (16 bits each)
then-
pick first two of each group
Code: Select all
# color_12='#440044004400'
# cut -c 1-3,6,7,10,11 <<< "$color_12"
#444444
s
- Fri 02 Sep 2016, 15:37
- Forum: Users ( For the regulars )
- Topic: X failure to load flag file?
- Replies: 2
- Views: 438
- Sun 21 Feb 2016, 17:47
- Forum: Programming
- Topic: GtkDialog - tips
- Replies: 1504
- Views: 911878
Perhaps adapting this approach-MochiMoppel wrote:don570 wrote:
Anyway, time entry can be tricky. You would need more tests to catch invalid times like 25:11:22 or 22:1:122.
Code: Select all
[[ $time_entry =~ ^[0-2]?[0-9]:[0-5][0-9]:[0-5][0-9]$ ]] && echo yes
s
- Thu 14 Jan 2016, 00:39
- Forum: Programming
- Topic: GtkDialog - tips
- Replies: 1504
- Views: 911878
- Thu 03 Dec 2015, 19:11
- Forum: Programming
- Topic: (Solved) How to replace text blocks inside a Script?
- Replies: 13
- Views: 4874
LazY Puppy,
How about this for lines in bash-
Text blocks would be tricky.
Cheers,
s
(when can we see the "topless" code )
How about this for lines in bash-
Code: Select all
line='some line to replace'
line_2='a replacing line'
# echo ${line/$line/$line_2}
a replacing line
Cheers,
s
(when can we see the "topless" code )
- Sat 07 Nov 2015, 01:24
- Forum: Programming
- Topic: YAD - Tips
- Replies: 837
- Views: 336918
image-on-top
Bert,
It seems that "image-on-top" isn't what it appears to be.
https://code.google.com/p/yad/issues/detail?id=113
Cheers,
s
It seems that "image-on-top" isn't what it appears to be.
https://code.google.com/p/yad/issues/detail?id=113
Cheers,
s
- Fri 04 Sep 2015, 20:45
- Forum: Beginners Help ( Start Here)
- Topic: Execute Bash commands from Gnumeric?
- Replies: 12
- Views: 2701
- Wed 02 Sep 2015, 21:05
- Forum: Programming
- Topic: Web Programming
- Replies: 93
- Views: 75802
Converting scanned bitmap images of graphs from books and journals to csv files (data points) is done quite well by this windows program. http://www.chem.uoa.gr/misc/specscan.htm I wonder how it works? Is there web code that could do similar? kjdixo, I've often thought of converting bitmaps to svg ...
- Sun 05 Jul 2015, 15:48
- Forum: Programming
- Topic: SMS backup messages - strip text from .vmg files [SOLVED]
- Replies: 68
- Views: 16572
Another approach would be to grab the data between "BEGIN:VBODY" and "END:VBODY" (that's assuming all messages only go there)
Then any multi-line data after "TEXT" could be handled.
Cheers,
s
Code: Select all
sed '/^BEGIN:VBODY/,/^END:VBODY/!d;//d' msgfile
Cheers,
s
- Sat 04 Jul 2015, 17:58
- Forum: Programming
- Topic: SMS backup messages - strip text from .vmg files [SOLVED]
- Replies: 68
- Views: 16572
This is a very engaging discussion. MochiMoppel mentioned- @seaside Wouldn't fdate=${fdate%% *} remove the time strings? Yes, starting from the end of the string remove all chars up to and including the furthermost space. Greengeek, this is probably not a good time to bring this up, but isn't this s...
- Sat 04 Jul 2015, 01:29
- Forum: Programming
- Topic: SMS backup messages - strip text from .vmg files [SOLVED]
- Replies: 68
- Views: 16572
- Mon 29 Jun 2015, 15:26
- Forum: Programming
- Topic: Geany - automate "replace" with regular expressions??
- Replies: 36
- Views: 8808
greengeek, you mentioned.... The first time i tried these they seemed to work ok but now I try them again it seems that they do not process the final text field. No matter how many Date/TEXT lines I add, the last TEXT field is always missing. Is it just me? Probably, there is no blank line at the en...
- Sat 27 Jun 2015, 16:44
- Forum: Programming
- Topic: Geany - automate "replace" with regular expressions??
- Replies: 36
- Views: 8808
Here's a one liner sed...
It just appends the line below to the one above and removes unwanted items.
Cheers,
s
Code: Select all
sed -e 'N;s/\(.*\)\n\(.*\)/\1\2/' -e 's/Date:/ /' -e 's/TEXT:/ /' -e 's/\.[0-9]\{4\}//' msgs
Cheers,
s
- Mon 22 Jun 2015, 19:54
- Forum: System
- Topic: savefile2dir 1.6 - Convert savefile to savefolder
- Replies: 29
- Views: 19192
gyro,
Another way to get the filesystem type
Cheers,
s
Code: Select all
FSTYP="`df --output=fstype \"$imgFile\" | tail -1`"
Code: Select all
file "$imgFile"|awk '{print $5}'
s