Bash command in title?
how do i put the command in my title? i'm playing around with $BASH_COMMAND but cant get it to work. here's the relevant section i have now in my bashrc:
PROMPT_COMMAND='echo -ne "\033]0;${USER}: ${PWD/$HOME/~}\007"'
thanks for any and all help.
Hi,
thanks a lot..
I used the following code.. it worked well..
===============================================================
String cmd[] = {"bash","/home/kulandaivelu/Desktop/works other's/test.sh"};
Runtime.getRuntime().exec(cmd).waitFor();
===============================================================
Thanks a lot again..
Similar Messages
-
Bash commands not working after upgrade to Lion
After upgrade, many BASH commands not working. For example, such a fundamental thing as "ls".
iMac20:bin a$ ls
Launch of "ls" failed: the PowerPC architecture is no longer supported.
What does it have to do with PowerPC? My computer is 2.66 GHz Inter Core DuoLinc,
iMac20:~ a$ which ls
/sw/bin/ls
Also, I managed to look (using tcsh's ls-F command) into the contents of /usr/. Here's what I see there:
[iMac20:/bin] a% ls-F
[* csh* echo* ksh* mkdir* rcp* stty* wait4path*
bash* date* ed* launchctl* mv* rm* sync* zsh*
cat* dd* expr* link* pax* rmdir* tcsh*
chmod* df* hostname* ln* ps* sh* test*
cp* domainname* kill* ls* pwd* sleep* unlink* -
Bash command doesn't work after update
I just ran pacman -Syu as normal, but some got many errors like below:
( 3/11) upgrading binutils
error: command failed to execute correctly
and every package except kernel-headers got a error message like that. and then i found most of my bash command doesn't work any more, just like ls and vim. However, some others like pwd and cd still work correctly.
Any one any ideal?
Last edited by ranjiao (2009-11-12 13:26:01)ranjiao wrote:I removed /lib64 and make a soft link from /lib64 to /lib, as Matlab09 requires a /lib64 containing crt libs.
is this the cause?
Yes.
I've done that before and got into the same problem when updating glibc, the lesson here, don't mess with the default directory structure. -
Where can I find the LOG file for bash/command history typed into Terminal?
Where can I find the LOG file for bash/command history typed into Terminal?
For 2 weeks ago I was searching for a log file on my server. Somehow I opend a file where I could see a list of all bash-commands I had ever entered into OSX Terminal.
Now I need this file.. but cant find it.
What is the official location for this LOG file?
Thank you so much for helping.cat .bash_history
-
How can i use BASH commands to get files Added on a certain month?
(I can use only date,ls,cut,awk,sed).
please help if anybody know...(I can use only date,ls,cut,awk,sed).
Pretty restrictive bash script If that's the only commands you can use. What's putting on these restrictions?
Does it have to be a bash script? Or are you just want something to produce those results? Because the system's find (command+f) or utilities like Find any File can do this. Just look for a mod date within a range.
For bash do a google search for something like "os x bash to get mod date" for script suggestions. -
Accessing Bash Command on Lion OS X.
Hello Apple Forum Community. Can anyone help me to understand how you access Bash in Lion (through which Utilities)? If you are not a professional programmer or developer, is Bash command still worthy of being educated about on your Mac? A website was describing a Bash command prompt for UNIX passwords; hence, could using Bash to generate and/or organize your passwords be your best bet? Should we really trust 'random password generator' websites to create UNIX passwords, or are we simply wasting our time if we are really not creating the proper password for our Lion OS X.
What other functions can Bash be useful for? Are there a few simple ways to know and/or get into Bash (to know a few advantageous command prompts) for the general Mac user. Are any Bash commands different for OS X Lion, or are there new ones as well? Thanks.Open Applications->Utilities->Terminal.
I believe the default shell for at least the last few releases is bash, so you'll get straight to it (though I have mine set to tcsh). If not, just type /bin/bash to start a bash shell.
Random password generator sites are fine - all they do is generate a random sequence of characters. However, you're probably going to have to write that password down to remember it, which makes it less secure. Better to come up with a sequence that has some mnemonic meaning to you, that contains uppercase and lowercase letters, numbers and other characters, and is at least eight characters long.
I doubt there's any need for the "general Mac user" to be using a shell, but if you are interested in programming or getting to know how the OS works "under the hood", then it's worth learning about. There are any number of good resources on the web about UNIX shells. -
After an update from leopard to lion my bash command clear does not work.
If I open terminal and type clear this happens...
Last login: Wed Jul 4 19:07:27 on ttys000
You have new mail.
pancake:~ machinename$ clear
Launch of "clear" failed: the PowerPC architecture is no longer supported.
pancake:~ machinename$
I have tried to copy a copy of the terminal app from another functioning machine running lion, but when it runns on the upgraded machine the result is the same.
How can I fix this?Sorry I better correct some of the info.
My bash command clear does not work.
If I open terminal and type clear this happens...
The machine was bought with Lion preinstalled and the Migration Assistant was use to transfer everything for a user from a Leopard machine.
Last login: Wed Jul 4 19:07:27 on ttys000
You have new mail.
pancake:~ username$ clear
Launch of "clear" failed: the PowerPC architecture is no longer supported.
pancake:~ username$
When attempting to delete the terminal program on the system it is prevented with the message:
“Terminal” can’t be modified or deleted because it’s required by Mac OS X.
I then copied a terminal program from another Lion machine but it shows the same message for the command Clear on this machine, but not the machine it was copied from.
Any ideas is greatly appreciated... -
Executing a bash command from Java
I want to execute a bash command from within a Java application on the server. I know how to do simple commands, but this command is killing me. I get nothing back when I send it.
p = Runtime.getRuntime().exec(new String[]{"ps","-ef","","grep","evolution"});
There is also another part where I want the results piped to awk and fetch out the pids. BUt with this not working the rest is a waste for now.
Robbieevgeni00 wrote:
Thank you for assuming the posters' stupidity.I can only see the information that you provide. You didn't say you tried the recommendations.
I read the article and I tried the things he/she is proposing, also the error stream, guess what it outputs: nothing.Maybe you did it wrong. If you didn't do it wrong, then that program you're invoking is poorly written, because it dies in error without producing any error messages.
And I also searched for the exitValue 138, but didn't get much further than that its some system specific value. If you know where I can find more information, I would appreciate if you let me know about it. As jschell pointed out it's probably app specific. You can search the source code and/or documentation of that program to see if they say what 138 means.
Apart from that -- it seems that environment and run directory issues can trip this up. Try checking that stuff out. Maybe your program expects something on the executable PATH that isn't there. Or maybe you're not running it in the working directory that you think you are. -
Is there a way that I can run a snmpwalk / isi devices (to find the status of the disk drives in islon) / any Linux bash command using a 2 state monitor Unix/Linux shell command and target a storage device (Isilon in my case) and not target a Unix/Linux
machine. I tried creating one and it complained saying,
Is there a way I could run a bash command in my isilon storage and use the ouput to determine the state of the monitor? Please let me know
Hari VFor Unix/Linux shell command in Operation Manager to monitor 2 state, you can refer to below link
http://contoso.se/blog/?p=2680
http://stefanroth.net/2012/10/21/scom-2012-linux-two-state-monitor-with-script-in-script/
http://operatingquadrant.com/2012/02/01/opsmgr-2012-unixlinux-authoring-templates-more-information-on-the-shell-command-templates/#more-746
Please remember, if you see a post that helped you please click (Vote As Helpful" and if it answered your question, please click (Mark As Answer). -
How to use 'bash' command in java?
Hi,
I am using Linux operating system
when i run the following code, 'test.sh' not started
================================================================
String cmd = "bash \"/home/kulandaivelu/Desktop/works/other's works/test.sh\"";
Runtime.getRuntime().exec(cmd).waitFor();
================================================================
but it started when i use same command(bash "/home/kulandaivelu/Desktop/works/other's works/test.sh") in terminal
anyone let me know what mistake i made in the code piece..
Thanks in Advance
KulandaiveluHi,
thanks a lot..
I used the following code.. it worked well..
===============================================================
String cmd[] = {"bash","/home/kulandaivelu/Desktop/works other's/test.sh"};
Runtime.getRuntime().exec(cmd).waitFor();
===============================================================
Thanks a lot again.. -
How place an LD_PRELOAD bash command into a .desktop file (LXDE)
To enable video in Skype with my webcam I must launch skype the following way:
LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so skype
To get that command done from my LXDE menu I tried to edit the skype.desktop file and place that line after the "Exec" desktop spec. It does not work, in quotes or not, nor with a full pathname to skype.
How can I force my desktop entry to run the command above?bash -c "LD_PRELOAD=... skype" should work too, for example.
-
http://discussions.apple.com/forum.jspa?forumID=758&start=0
I found this topic above but believe it's assuming things that I do not know. Since I cannot reply to it, I'm starting another thread.
I've changed to bash using Netinfo but have lost the default commands.
Here is the contents of my .bash_profile:
. ~/.bashrc
ENV=$HOME/.bashrc
export ENV
Where would the default commands go?
Where would I place additional commands/applications?
thanx, samhttp://discussions.apple.com/thread.jspa?messageID=3511247�
is the link I meant to copy (thought I did that correctly)
By "default commands" I meant ls -al, etc.
/bin/echo $PATH yielded an older path to mysql.
When I emptied the file, I got the defaults:
/bin:/sbin:/usr/bin:/usr/sbin
which I now have gotten back, thank you.
Now my follow-up, is what is the structure to add more, say mysql, ruby, etc?
Is there a comment character that can work on a line basis?
Should I just separate all these with a colon?
Or just add as a separate line?
thanx, sam -
Bash: command not found after piping
Hi,
I'm trying something quite commonly found in an Unix environment, namely piping the output of one command into the input of a subsequent one, eg.
bash$ ps ax | grep -i bash
But unfortunately I'm receiving--and now comes the most curious part--most of the times (not always!!) an error message
bash: grep: command not found
When calling grep directly
bash$ grep
the resulting output is
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
"which"-ing the commands
bash$ which bash ps grep
results in
/bin/bash
/bin/ps
/usr/bin/grep
Cheers,
MMHeinGood, you tried a different shell. sh and bash are essentially the same executable on Mac OS X.
Did you try a new user account? What were those results?
Have you tried installing your own bash? Either build from sources, or use something like MacPorts.org to install one already configured for Mac OS X.
You also have ksh and zsh if they happen to rock your boat (see /etc/shells for a list of installed shells).
I think both Linc an dI agree that we have never seen this situation before either, which is why we suspect something has become corrupt. The "Nuke and Pave" approach tends to eliminate that possibility. But since you have lots of Unix experience (even though you missed a few Unix flavors ), and want to find the root cause, then you need to start doing tests that eliminate components.
The shells on my Mac OS X 10.7.2 Lion system have the following chksum's
cksum /bin/*sh
188949626 1371648 /bin/bash
1672788767 772992 /bin/csh
4164734636 2180736 /bin/ksh
1711289041 1371712 /bin/sh
1672788767 772992 /bin/tcsh
2366092939 1103984 /bin/zsh
I would expect yours to be identical. But that does not take into account any libraries used. And if you have the same values, then you need to look at something else (again, a new account can go a long way to eliminating things in your environment, or pointing to a system component). -
Since two days, I have a problem running some system commands, for example:
mkinitcpio
reboot
lspci
etc.
The result being: bash: mkinitcpio: command not found
The files are there, but work only if I give full path to them. I know it has something to do with the PATH variable not being loaded at the start of system, but I do not know how to fix it.
Help, please.
Last edited by Lockheed (2011-05-13 21:31:31)$ echo $PATH
/usr/lib/libfm:/bin:/usr/bin:/usr/local/bin:/home/juha/bin
$ cat /etc/profile
# /etc/profile
#Set our umask
umask 022
# Set our default path
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
export PATH
# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -r "$profile" && . "$profile"
done
unset profile
fi
# Source global bash config
if test "$PS1" && test "$BASH" && test -r /etc/bash.bashrc; then
. /etc/bash.bashrc
fi
# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP
# Man is much better than us at figuring this out
unset MANPATH -
HELP : "LINUX BASH COMMANDS" Java Native Interface
how can i create a program using Java Native Interface that could run or recognize LINUX BASH COMMANDS
Runtime.getRuntime().exec(<command>); But read this:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Maybe you are looking for
-
My new iMac ( summer 2010 - July 2010 ) internal Hard Drive is failing.. 1) sometimes the imac can't see the hard drive to boot from.. it would stay in the grey screen .. 2) sometimes the imac boots up after a cold start. but some appli
-
Count of tokens using group by + SYN operator + Spell Checking + Stemming
Hi, I have a text data on which i have created context index and populated the tokens table using "CTX_DOC.TOKENS" procedure. Now i want to find the number of occurences of tokens using count and group by function. I am using the foll query on table
-
After Upgrade, Windows Service will not start automaticly
I just upgraded from 10.2 to 10.4. When I did the Windows File Service, will not start automaticly. I can start it manually, after a reboot. Any idea on how to fix this?
-
Bug in Pro*C on Linux!
When I have installed Oracle8i Release 8.1.5.0.1 on Linux(kernel is 2.2.10). I use Pro*C/C++: Release 8.1.5.0.0 to precompile the programme list below. I run this programme to connect to Oracle8 Enterprise Edition Release 8.0.4.0.0 installed on Digit
-
New bridge doesn't open in 10.6.8 - anyway to uninstall and use previous version
Have updated bridge without realising it won't run on Mac os 10.6.8. Don't want to upgrade particular machine to Mavericks yet. Is there anyway to uninstall / reinstall previous version?