Search found 24 matches

by chowse
Mon Apr 08, 2019 9:03 am
Forum: Scripts & Bash
Topic: [SOLVED] Sort by last 6 characters in dir name
Replies: 2
Views: 174

Re: Sort by last 6 characters in dir name

Hello rene,
Your awk example works Perfect!!
It'a a 'one-liner', too. Just what I wanted!

Thank you kindly!
by chowse
Sun Apr 07, 2019 9:48 pm
Forum: Scripts & Bash
Topic: [SOLVED] Sort by last 6 characters in dir name
Replies: 2
Views: 174

[SOLVED] Sort by last 6 characters in dir name

Hi, How can I cd to a directory and sort the files by the last 6 characters? i.e. unsorted file 1 (2001) another file (1999) a file with a rather long name (2002) now sorted another file (1999) file 1 (2001) a file with a rather long name (2002) I've looked at posts using sort -k, but have had no lu...
by chowse
Mon Mar 19, 2018 7:48 am
Forum: Scripts & Bash
Topic: rename file, mkdir, mv file
Replies: 4
Views: 1177

Re: rename file, mkdir, mv file

rene,
Works perfect! You don't know how much time and trouble you've saved me. Thank you kindly.

Charles
by chowse
Sun Mar 18, 2018 10:32 pm
Forum: Scripts & Bash
Topic: rename file, mkdir, mv file
Replies: 4
Views: 1177

rename file, mkdir, mv file

Hi, I have several directories with hundreds of files in each. I must rename each file, create a directory of (almost) the same name, and move the file into that directory. Here is what I have so far (not much): #!/bin/bash for file in /foo/* do rename the file so that the last 4 characters before t...
by chowse
Wed Jan 10, 2018 10:17 am
Forum: Non-technical Questions
Topic: [SOLVED] PM to another user stuck in "Outbox"?
Replies: 1
Views: 746

[SOLVED] PM to another user stuck in "Outbox"?

I composed a PM to another user, then clicked "Submit".
I see the msg in my "Outbox". I would normally think that something is wrong. Is it stuck or is that the way it works?

Rergards,
Charles
by chowse
Tue Dec 26, 2017 10:00 pm
Forum: Scripts & Bash
Topic: log the exit code of a script after it completes[SOLVED]
Replies: 15
Views: 1312

Re: log the exit code of a script after it completes

Sorry, looks like I missed a space there. Change line 20 from if [ $lasterr -ne 0]; then to if [ $lasterr -ne 0 ]; then (put a space after the 0 before the closing bracket). You may be looking at my post before I edited it. I found the missing space and corrected it. Script works great! Thank you k...
by chowse
Tue Dec 26, 2017 9:21 pm
Forum: Scripts & Bash
Topic: log the exit code of a script after it completes[SOLVED]
Replies: 15
Views: 1312

Re: log the exit code of a script after it completes

[quote="FreedomTruth"] (not tested -- if it's buggy and you need more help I can try again)

Code: Select all


This looks good!  
Your script did exit with status 1 after I changed the chown to bob instead of charles!!

May I add you as a Friend?
Thank you kindly!
Charles
by chowse
Tue Dec 26, 2017 6:32 pm
Forum: Scripts & Bash
Topic: log the exit code of a script after it completes[SOLVED]
Replies: 15
Views: 1312

Re: log the exit code of a script after it completes

Ah, we have a permission issue at hand. root owns "backup.txt" at this point; the bakup.sh has finished, so our unprivileged user cannot append to the file. One ugly way around this is to sudo the echo command too: sudo ./bakup.sh ; sudo bash -c "echo -e \"\nExited with status of \"$? >> backup.txt...
by chowse
Tue Dec 26, 2017 6:09 pm
Forum: Scripts & Bash
Topic: log the exit code of a script after it completes[SOLVED]
Replies: 15
Views: 1312

Re: log the exit code of a script after it completes

Also, simply replacing && with ; will not do what you might expect: sudo ./bakup.sh ; echo >> backup.txt ; echo "Exited with status of" $? >> backup.txt should always report an exit status of 0. Why? Break it down ... (1) sudo .bakup.sh -- returns error 1 for example (2) echo >> backup.txt -- now r...
by chowse
Tue Dec 26, 2017 3:59 pm
Forum: Scripts & Bash
Topic: log the exit code of a script after it completes[SOLVED]
Replies: 15
Views: 1312

Re: log the exit code of a script after it completes

Changing either the username or the path to one that doesn't exist should have chown return exit code 1. chown charles /home/charles/backup.txt Thanks for the reply. That did indeed cause the script to exit with 1, but it did not write to backup.txt... charles@MOE ~ $ sudo ./bakup.sh && echo >> bac...
by chowse
Tue Dec 26, 2017 2:39 pm
Forum: Scripts & Bash
Topic: log the exit code of a script after it completes[SOLVED]
Replies: 15
Views: 1312

log the exit code of a script after it completes[SOLVED]

Hello && Merry Christmas && Happy New Year! I will run this script from crontab. #!/bin/sh ## REQUIRES 'sudo' or run from crontab # Exit on errors? set -e #Start with an empty backup.txt file [ -f /home/charles/backup.txt ] && rm /home/charles/backup.txt || touch /home/charles/backup.txt date >> /ho...
by chowse
Tue Dec 26, 2017 11:49 am
Forum: Software & Applications
Topic: Unnecessary Startup Applications
Replies: 8
Views: 1327

Re: Unnecessary Startup Applications

Assuming you're using PIA VPN, might install applications from the Flatpak category in Software Manager (knowingly or not), I wouldn't turn off more than you have already done in the screenshot. What would be the point of switching them off for you? They either use no measurable amount of resources...
by chowse
Mon Dec 25, 2017 2:30 pm
Forum: Software & Applications
Topic: Unnecessary Startup Applications
Replies: 8
Views: 1327

Unnecessary Startup Applications

Which of these can I turn off?
Screenshot from 2017-12-25 12-25-16.png
Thanks,
Charles
by chowse
Fri Dec 08, 2017 10:01 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

Re: login to live cd as Root

I have a lot of experience in this sort of thing in Windoze, and it was always necessary to erase the SSD before writing an image to it. Wondering if that's true in Mint. It has never been necessary to secure erase an SSD in any operating system, including Windwoes. And, depending on how you do the...
by chowse
Fri Dec 08, 2017 9:27 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

Re: login to live cd as Root

--sigh-- You could have guessed this one... sudo cp /media/mute/toshipod2/2017-12-08-sda1-ext4.img /dev/sda1 Yes, that much was obvious. Respectfully, I'm still wondering about doing all this as 'charles' or needing to boot to the live cd and do it from there. Also, my long experience with SSD's te...
by chowse
Fri Dec 08, 2017 8:39 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

Re: login to live cd as Root

"...if that makes sense..." Oh yes. Just replace the destination with a file name on the backup drive... sudo cp /dev/sda1 /media/mute/toshipod2/2017-12-08-sda1-ext4.img That might be the problem you started with, if you told Disks to write to a mounted partition instead of to a file in the mounted...
by chowse
Fri Dec 08, 2017 7:41 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

Re: login to live cd as Root

Thanks for the reply! I have a Parted Magic boot disc, and have made drive images with Clonezilla. Haven't had the courage to Secure Erase my SSD and restore an image to test it. There's no need to secure erase an SSD before restoring an image, and clonezilla has saved my neck more times than I can...
by chowse
Fri Dec 08, 2017 6:36 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

Re: login to live cd as Root

"can I become root for all things in the live cd" Yes. That's all I am going to say. It should be sufficient to just run Disks . A 'permissions' problem might be because the destination is mounted, for example. Being root won't help with that. Imaging a drive doesn't need Disks ... sudo cp /dev/sr0...
by chowse
Fri Dec 08, 2017 6:30 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

Re: login to live cd as Root

If you need to make an image for backup purposes, you're better off using clonezilla. http://clonezilla.org/downloads/download.php?branch=stable Thanks for the reply! I have a Parted Magic boot disc, and have made drive images with Clonezilla. Haven't had the courage to Secure Erase my SSD and rest...
by chowse
Fri Dec 08, 2017 5:02 pm
Forum: Installation & Boot
Topic: [SOLVED] login to live cd as Root
Replies: 14
Views: 321

[SOLVED] login to live cd as Root

The title says it all...how can I become Root for all things in the live cd?

Many thanks,
Charles

[Edit] I suppose I should explain. I want to boot the live cd and open the Disks utility to make an image of the sda drive, but I am always presented with "You don't have permission to..."

Go to advanced search