Search Results

Search: Posts Made By: dkieran
3,712
Posted By dkieran
Thanks for the help guys, that sorted it out!!
Thanks for the help guys, that sorted it out!!
3,712
Posted By dkieran
Using grep inside a test
Hi,
I want to use grep inside a test statement, but I am getting an error message.

Two variables

testvarNum=5
testvarNonNum=x

echo $testvarNum | grep [0-9][0-9]*

The result of this is...
21,622
Posted By dkieran
Test whether absolute path in variable
I'm using the following line in bash to test whether an argument supplied is an absolute path or not:

if echo $1 | grep '^/' > /dev/null
then
absolute=1
else
absoute=0
fi...
4,935
Posted By dkieran
Thanks, Jean-Pierre, that's fixed it!
Thanks, Jean-Pierre, that's fixed it!
6,130
Posted By dkieran
Thanks very much, that's fixed it.
Thanks very much, that's fixed it.
6,130
Posted By dkieran
Remove a file called -r using rm
Is there any way to remove a file named "-r" using "rm", because "rm" assumes that file is one of it's options if I type "rm -r" and then throws an error message?
I also tried "rm -r -r" and that...
4,935
Posted By dkieran
Another getopts problem, similar to the above....
Another getopts problem, similar to the above. How to account for the situation where someone types the following:

command -ri file1 -v file2

My code above cannot handle that.

So here is...
2,384
Posted By dkieran
That simple! Cheers!
That simple! Cheers!
4,935
Posted By dkieran
Thanks, Ill check that one out.
Thanks, Ill check that one out.
2,384
Posted By dkieran
trying to list everything in a folder except . and ..
I want to list everything in a directory, including dotfiles (example .file1) except for the . and .. that are in every folder.
I'm guessing it's some sort of regular expression I need.
So far, I...
4,935
Posted By dkieran
getopts standard approach - does one exist?
Hi,
I've just been looking through all the getopts related posts and there appear to be many different approaches to reading a command and its options in and checking for errors.
However, the only...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 07:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy