Search Results

Search: Posts Made By: boqsc
1,936
Posted By Corona688
That you can run sudo -n true doesn't always mean...
That you can run sudo -n true doesn't always mean you're root. Sometimes it just means you ran sudo recently enough it isn't asking for your password again. Check if UID is 0 too.
5,744
Posted By Corona688
Those are round braces, not curly braces, and...
Those are round braces, not curly braces, and they create a sub-shell. Right now their only side-effect is wasting time and memory, but if you make a habit of that you'll discover that variable...
5,744
Posted By Corona688
For starters, you almost never need to use $?, a...
For starters, you almost never need to use $?, a normal if-statement will do. Written this way, you can kind of see the logic. "If not sudo, then ..."

Not sure if it's really a simplification...
5,744
Posted By rbatte1
If you move the sudo outside the if (and...
If you move the sudo outside the if (and therefore run it every time) the code will call itself every time, and call itself, and call itself..........

The exit is necessary because otherwise you...
5,744
Posted By bakunin
Not seeing from here what "$0" (the running...
Not seeing from here what "$0" (the running programs name) and "$@" (a list of all comand line arguments to the running program) contains or any other parts of the environment you execute the snippet...
Showing results 1 to 5 of 5

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