Search Results

Search: Posts Made By: dasx
5,241
Posted By dasx
But with $@ I don't need to use the quotes...
But with $@ I don't need to use the quotes really, it works without them.

---------- Post updated at 03:34 PM ---------- Previous update was at 03:33 PM ----------



:b:
$1 - $9 these...
5,241
Posted By dasx
That does indeed work, thanks! Does anybody...
That does indeed work, thanks!

Does anybody know of somewhere I could look up all ways of using the $?

I mean:


$1, $2, $9
$!
$@
$*
$?
(I'm sure there's more...)
5,241
Posted By dasx
Thanks Scott!!! This didn't work though: ...
Thanks Scott!!!

This didn't work though:

suddo(){
sudo /bin/bash -c "source ~/.bash_profile ; $@"
}


Tried this other and worked. :)

suddo(){
a=$@
sudo /bin/bash -c "source...
5,241
Posted By dasx
Amazing. Finally got it working! Only bad...
Amazing. Finally got it working!

Only bad thing is I must use quotes if I'm passing any options to my custom functions but hey, much better than before!
suddo(){
sudo /bin/bash -c "source...
5,241
Posted By dasx
How should I proceed, then? Thanks.
How should I proceed, then?

Thanks.
5,241
Posted By dasx
That does actually work! Thanks! I was trying...
That does actually work! Thanks!
I was trying to set a function or an alias to do the most part of the writing for me (because if not, this still is faster: sudo -s; source .bash_profile; foo).
...
5,241
Posted By dasx
I must assume then there's no possible way of...
I must assume then there's no possible way of doing this?

Thanks.
5,241
Posted By dasx
Sudo function
I have my .bash_profile with this function for instance:

foo(){
if [ `id -u` -ne 0 ]
then echo "RUN COMMAND AS ROOT"
else echo "F-O-O"
fi
}


If I launch terminal...
1,354
Posted By dasx
Yes, I can always put all my functions in the...
Yes, I can always put all my functions in the bashrc and be done with it. I just wanna know if there's any way to get the bash_profile sourced when logging in as root.

Thanks!
1,354
Posted By dasx
Sourcing as root automatically
Hey everyone!

I have my .bash_profile file which is read automatically when I launch Terminal therefore I can run my own functions.

BUT.

When I do:
sudo -s
sudo su
sudo su -

No matter...
Forum: OS X (Apple) 12-30-2012
2,224
Posted By dasx
Created a 100MB file and did what you said. ...
Created a 100MB file and did what you said.
b=0; while [ $b -eq 0 ]; do ps -A >> Desktop/file; if [ `du -d0 Desktop/file | awk '{print $1}'` -gt 204800 ]; then b=1; fi; done

Did it 4 times. Looks...
Forum: OS X (Apple) 12-30-2012
2,224
Posted By dasx
RAM Usage discrepancy
Hey there! I'm a new user here who registered because I couldn't get these kind of questions answered in the place I directly com from. :o

I've found a discrepancy in total RAM used and I can't...
Showing results 1 to 12 of 12

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