LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Blogs
User Name
Password

Notices

Old

Give a default/non-null value in order to avoid the "unary operator expected" error

Posted 02-19-2014 at 03:00 PM by the dsc (linux-related notes)
Tags bash

Quote:
Originally Posted by cfajohnson
Quote:
i am trying to compare a value with value 50. but i am getting
"[: -lt: unary operator expected"

I am using

if [ $j -lt 50 ]
then
echo "------------"

fi
Make sure that $j expands to a value. Best is to set it explicitly, but you can also give it a default value (0 in this example):


Code:
if [ ${j:-0} -lt 50 ]
http://www.unix.com/302295072-post3.html...
Member
Posted in Uncategorized
Views 233 Comments 0 the dsc is offline
Old

Linux users

Posted 02-19-2014 at 02:52 AM by redd9

I just found out that another girl I've known for ages is an avid Linux user! I've always been on the lookout for Linux users but have found it quite difficult to find anyone locally. Very happy about this, hope we can chat tomorrow. I also hope a guy a met who's currently working in America will come back to Canada, because he likes Linux too. Tux forever!
Member
Posted in Uncategorized
Views 225 Comments 0 redd9 is offline
Old

"Alpha" of an auto-renaming existing files "mv" script/function/alias

Posted 02-18-2014 at 01:02 PM by the dsc (linux-related notes)

Please don't test this on files you don't care to lose/folders you don't care to mess. I just tested once with an explicit (non-variable/"$2") destination, it seems to have worked. I don't have it as an alias or anything, it was just an "one liner" I came up with.

Code:
for on in "$1" ; do nn=$on ; num=1 ; until [ ! -f "$2/$nn" ] ; do nn="$(echo $nn | sed 's| ([0-9]*)||' | sed "s|\.| ($num).|")" ; num=$((num+1)) ; echo $nn ; done
...
Member
Posted in Uncategorized
Views 205 Comments 0 the dsc is offline
Old

The Ultimate Linux System with kernel 3.13.3 – latest

Posted 02-16-2014 at 05:46 AM by exton (Exton's Blog)
Updated 02-22-2014 at 03:52 AM by exton

NEWS about ExTiX 14 version 140222

1. The ExTiX ISO is now a ISO-hybrid, which means that it can very easily be transferred (copied) to a USB pen drive. You can then even run ExTiX from the USB stick and save all your system changes on the stick. I.e. you will enjoy persistence! I’ve found two scripts which make the installation to USB very simple. The scripts are quite ingenious.
2. Another big improvement is that ExTiX 14 can run from RAM. Use Boot alternative 2 (Copy to RAM...
ExTiX Admin
Views 179 Comments 0 exton is offline
Old

Why use Linux?

Posted 02-15-2014 at 03:33 AM by exton (Exton's Blog)

I found something memorable about Linux on the Internet. I reproduce it here. The author is unknown to me.

: () { : | : & } ; :

We tell people we use Linux because it's secure. Or because it's free, because it's customizable, because it's free (the other meaning), because it has excellent community support...

But all that is just marketing bullshit. We tell that to non-Linuxers because the wouldn't understand the real reason. And when we say those...
ExTiX Admin
Posted in Linux
Views 372 Comments 3 exton is offline

  



All times are GMT -5. The time now is 02:34 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration