Usually work in Windows, but trying to setup RabbitMQ on my Mac. Can someone let me know what the line below does?
[ "x" = "x$RABBITMQ_NODE_IP_ADDRESS" ] && [ "x" != "x$NODE_IP_ADDRESS" ] && RABBITMQ_NODE_IP_ADDRESS=${NODE_IP_ADDRESS}
Specifically, I'm curious about the [ "x" = "x$RAB..."] syntax.
I have some proxy settings that I only occasionally want to turn on, so I don't want to put them in my ~/.bash_profile. I tried putting them directly in ~/bin/set_proxy_env.sh, adding ~/bin to my PATH, and chmod +xing the script but though the script runs, the variables don't stick in my shell. Does anyone know how to get them to stick around for the rest of the shell session?
Hi
I am reading the Excel sheet in c# using interop services. My excel sheet have the date columns of formate dd/mm/yyyy. while reading , runtime i am getting some different values for each cell as :38840,38808,39873...so n so... what does that mean? please help.How to handle the date columns of the excel sheet in C#. please guide me.
I sweated over the question above. The answer I'm going to supply took me a while to piece together, but it still seems hopelessly primitive and hacky compared to what one could do were completion to be redesigned to be less staticky. I'm almost afraid to ask if there's some good reason that completion logic seems to be completely divorced from the program it's completing for.
Hi guys,
I have a set of .php files in a folder, I want to add text just before these lines:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
What i want is to insert just before these lines in the html file. So just want to prepend that file before each docType declaration. However the DOCTYPE declaration is never on line 1, as there is loads of php lines before.
I have this current script (where FE is the folder containing all the scripts i want to edit):
for file in ${fe}*; do
echo "$file"
done
Thanks,
I have start and end dates which are stored in a database in this format:
start date= 20121004 //4th October 2012
end date= 20121004 //16th November 2012
so I can use date format:
$date = date("Ymd"); // returns: 20121004
to determine when to display and not display
to repopulate my update input boxes I use:
$start=(str_split($stdate,4));// START DATE: splits stored date into 2x4 ie: 20121209 = 2012 1209
$syr = $start[0];// re first half ie: 2012 which is the year
$start2 = $start[1];//re second half ie: 1209
$start3=(str_split($start2,2));// splits second half date into 2x2 ie: 1209 = 12 09
$smth = $start3[0]; // first half = month ie: 12
$sday = $start3[1]; // second half = day ie: 09
$expiry=(str_split($exdate,4)); ///SAME AGAIN FOR EXPIRY DATE ...
$xyr = $expiry[0];
$expiry2 = $expiry[1];
$expiry3=(str_split($expiry2,2));
$xmth = $expiry3[0];
$xday = $expiry3[1];
which works fine but I need to repopulate the input boxes for the month showing the date in the database like this
<option value="01">January</option`>
using
if ($smth==01):$month='January'; endif;
if ($xmth==01):$month='January'; endif;
// if the start and/or expiry month number = 01 display $month as January
if ($smth==02):$smonth='February'; endif;
if ($xmth==02):$smonth='February'; endif;
if ($smth==03):$month='March'; endif;
<select name="stmonth" class="input">
<option value="<?=$smth?>"><?=$month?></option>
...
</select>
is there an easier way to display IF EITHER ONE EQUALS rather than having to write the same line twice once for each $smth AND $xmth ?
re: if ($smth **and or** $xmth ==01):$month='January'; endif;
I Have a model like this
foo=models.char
bar=models.dateime
In wich several foos arrives in one day in different time. I need to list all the foos in a specific date, no matter the time they arrive.
I can't change the model, so splitting the bar in two fields(one for date and one for time) is out of reach right now :(
Can anybody confirm if by setting the the following environmental variables under debian lenny will make previous history entries not to be saved. GNU bash, version 3.2.39(1)-release
export HISTCONTROL=ignoreboth
export HISTSIZE=500
I have added them to my /etc/bash.bashrc but I keep getting repeated commands.
Thanks
I have recently installed ubuntu hardy and found that shell command completion with TAB doesn't work, the package 'bash-completion' is installed in my system. I guess it is related to dash being the default shell? Is there a way to use tab completion in dash? If there isn't a way then how can i change my default shell to bash?
socat - exec:'bash -li',pty,stderr,ctty - bash: no job control in this shell
What options should I use to get fully fledged shell as I get with ssh/sshd?
I want be able to connect the shell to everything socat can handle (socks5, udp, openssl), but also to have a nice shell which correctly interprets all keys, various Ctrl+C/Ctrl+Z and jobs control.
Update: Found "setsid" socat option. It fixes "no job control". Now trying to fix Ctrl+D.
socat - exec:'bash -li',pty,stderr,ctty - bash: no job control in this shell
What options should I use to get fully fledged shell as I get with ssh/sshd?
I want be able to connect the shell to everything socat can handle (socks5, udp, openssl), but also to have a nice shell which correctly interprets all keys, various Ctrl+C/Ctrl+Z and jobs control.
/* Requested tags: socat job-control */
I am decent with bash scripting and I am catching on to regex, and a little sed usage. Is learning awk still worth while with all the alternatives out there. I am kind of averse to using perl, I see it as dying, for some reason I feel like bash is more of a survivor. Opinions?
After running a bash fork bomb which made my webserver down, I think I should be more careful even not under root.I thought it would be totally fine while I'm not under root.So I ignored the warning and ran the bash fork bomb which is :() { :|:& }; :
.(Please don't run it if u don't understand this code cuz it will make you system down).And I think I need a list of common ways those could cause a sever shutting down unexpectly even not under root.
Any suggestion would be appreciated.
Regards
`
GUI:
I changed the permissions of an sh file, so that I can read, write and execute it.
I double-clicked it, selected run in Terminal, but it didn't run.
I double-clicked it, selected run, but it didn't run.
Command-Line:
bash *filename* runs it
sh *filename* runs it
The file content is:
#!/bin/bash
# get dirsyncpro home
DIRSYNCPRO_HOME="$(dirname $0)"
# start programm and pass any parameters
java -Xmx512M -jar "$DIRSYNCPRO_HOME/dirsyncpro.jar" $*
Works in this person's computer:
http://www.knowliz.com/2008/08/how-to-installrun-sh-file-in-linux.html
What's going on?
Can anybody confirm if by setting the the following env variables under debian lenny will make previous history entries not to be saved. GNU bash, version 3.2.39(1)-release
export HISTCONTROL=ignoreboth
export HISTSIZE=500
I have added them to my /etc/bash.bashrc but I keep getting repeated commands.
Thanks
This is what happens - but why?
liuxiang@MacBookPro: ~/casecode/sh $ ls -l sa
-rwx---rwx 1 root admin 55 10 21 00:07 sa
liuxiang@MacBookPro: ~/casecode/sh $ cat sa
cat: sa: Permission denied
liuxiang@MacBookPro: ~/casecode/sh $ date >> sa
-bash: sa: Permission denied
liuxiang@MacBookPro: ~/casecode/sh $ ./sa
-bash: ./sa: Permission denied
Can I have different .bashrc files loading when logging into different nodes that share the same home dir?
This is, I am mostly interested to loading different PATH directories when logging as bash, depending on the different Linux nodes I log into? For example, if I log into bash in machine abc-01, I would like to have a given .bashrc loaded, but when I log into abc-02, that uses the same /home/username directory, I would like to use a different .bashrc. How can I go about doing that?
I run a .ksh containing a awk call. awk.exe and his shortcut awk is in /bin/awk, /bin is in the PATH environment variable. But when I try to launch awk, I have this error message :
bash: /usr/bin/awk: no such file or directory
Why didn't bash look for it in the /bin folder too?
edit : tar has the same rights, tar.exe is in /bin and can be listed in /usr/bin/, the exact same way than awk. Tar works fine whereas awk not.
Most advice for Mac is written assuming you use the Bash shell. If I switch to zsh, how incompatible do I become with current Bash scripts that I have on my system, and advice people on SU give me?
Does the #!/bin/sh line at the beginning of my scripts help?
Hi folks,
I would like to issue a command from a bash script to clear the terminal it is running from:
-I don't want to clear the bash history (history -c)
-I don't want to issue the clear command (which moves the terminal down to the last prompt, giving the impression the terminal has been cleared, but previous output remains visible if you scroll up)
-I want to completely remove all previous output to my terminal and have it clean as if I was opening a new one
Thanks.