LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices


Old

N00b method to toggle some verbosity on command for bash scripts

Posted 03-28-2016 at 11:32 PM by the dsc (linux-related notes)
Updated 03-28-2016 at 11:34 PM by the dsc
Tags bash, newbie

Just something I came up with that is probably not how actual programmers/scripters(?) would advise, specially the parameter/flag thing which is beside the point here.

Code:
if [[ $1 == "v" ]] ; then

ver(){
echo $@
}

else

ver(){
:    # ":" is a "do nothing" command
}

fi

a=10

echo normal output

ver verbose output $a
...
Member
Posted in Uncategorized
Views 147 Comments 0 the dsc is offline
Old

Welcome To My Blog

Posted 03-28-2016 at 12:23 PM by shsmith

Hi there, welcome to my blog! If you're wondering what I'm gonna talk about, well, so am I. I have been using Linux off and on since 2003 or there abouts. My first distro was Debian. Recently I got tired of microsoft's "I own you and you will use what I tell you to" attitude. I haven't booted into windows in a few weeks now.

The distros I'm running right now are Ubuntu 14.04LTS on my desktop and Linux Mint XFCE Edition on my laptop, which is an old Dell Inspiron E1505;...
LQ Newbie
Posted in Uncategorized
Views 153 Comments 0 shsmith is offline
Old

Replace trash-cli with kioclient move $@ trash:/ for cross-partition trashing

Posted 03-27-2016 at 09:17 PM by the dsc (linux-related notes)
Tags trash

However arguable, some people want to trash by moving into another partition's trash folders. The linux/unix/whatever trash specifications theoretically prohibit that, but KDE's implementation doesn't. So a linked or bind-mounted trash into a different partition will behave normally, except it will move the file across, obviously.

If you also use trash-cli, which won't work with such hacks, it can be replaced with the kioclient command, that in turn can be scripted or perhaps even...
Member
Posted in Uncategorized
Views 115 Comments 0 the dsc is offline
Old

New file name generator script/function, to avoid overwrites w/o user input

Posted 03-27-2016 at 07:11 PM by the dsc (linux-related notes)

Usage examples:

cp/mv/ln/etc file11.txt $(newname "/some/path/file11.txt")

cp/mv/ln/etc file11.txt $(newname "/some/path/whatever.txt")


If there's a file11.txt or whatever.txt already there, it will rename automatically to file11(1).txt or whatever(1).txt, and (N+1) from then on.

The whole path/name must be between quotes because of spaces and such things.

May be dangerous and somehow make you lose files...
Member
Posted in Uncategorized
Views 160 Comments 0 the dsc is offline
Old

Python & Gtk: virtualvenv (Test Post Ignore)

Posted 03-27-2016 at 02:30 PM by taupist
Updated 03-27-2016 at 02:34 PM by taupist

I'm thinking about writing a series of blog posts about my experience with Python and Gtk programming. For this post I'm going to get started by telling you how to set up a basic virtual environment for project development.
Okay, so if you don't already have a Projects directory, then you should create one in your Home folder. The path should look like this;
Code:
/home/your_username/Projects/
Next, you should open a terminal and navigate to that folder, and enter this command;
Code:
virtualenv
...
Member
Posted in Uncategorized
Views 277 Comments 0 taupist is offline

  



All times are GMT -5. The time now is 03:34 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration