General :: Cd Command Not Working In .cshrc File (bash Shell SUSE)?
May 29, 2011Just trying to execute cd command in a .cshrc file (bash shell in SUSE Linux) it says."No such file or directory".Do you see any reasons for this
View 3 RepliesJust trying to execute cd command in a .cshrc file (bash shell in SUSE Linux) it says."No such file or directory".Do you see any reasons for this
View 3 RepliesWhen I SSH to a certain Linux host, although my default shell is tcsh, the .cshrc file under my home directory is not sourced at all. I can't understand why this happens because from my understanding, if I'm using the tcsh, the .cshrc should be sourced anyway!
View 1 Replies View RelatedI am unable to use clear or cls command on bash shell. I have recently installed Cygwin and am using that for practicing unix commands.
I see that I can use Ctrl + L to clear the screen. I created an alias in my .bashrc to do the same as
alias cls='^L'
This is how i defined other aliases e.g.
And they work. Hence I assume cls will work too but this is what I get when I try to give cls on command prompt. Am i missing something? Is there a way to do this?
Then someone suggested, You cannot alias keystrokes to commands or vice versa. You could just alias cls to an echo command: echo -en "x0c"
And I added the following to .bashrc,
Sourced the .bashrc file. No errors but cls still does not clear the screen. Infact when I typed the echo -en "x0c on command prompt as well, nothing happened. What does this command do?
Cis 140 student.how to use the test command to evaluate whether the shell variable I create contains a referance to the bash shell? and use the echo command to determine the result.
View 1 Replies View RelatedI want to use ssh to execute a command and to wait endlessly to log everything (in file) that comes as a stream of the connected server. But unfortunately, in the manual its written "If command is specified, it is executed on the remote host instead of a login shell"
So what happens is that when I specify my command:
ssh user@server "my_command"
It executed the command and the flow of execution returns to bash shell. So basically my session ends right after the command is executed. This happens only in case I specify command in the command line. If I login into ssh manually and then type "my_command", then the session doesn't end. I want the ssh not to exit, because after "my_command" executes, I want to capture everything in the session.
I am supposed to take some small files, and print them to a specific printer, such that the small files are concatenated into one file. The file name has to be included in the file that gets printed.
Should I be looking to concatenate the files into one file with the file names included, and then print them?
something like: -printfunction -printername < file*
I create a bash script that writes another bash file. But in the generated bash file I want to write a bash command in the file and not executing it.Here's my bash file:
Code:
#!/bin/bash
cat > ~/generateGridmix2data.sh << END
[code]...
I'm trying to change the root directory to /tmp/somedir using chroot, but even using sudo or su-ing to root I get the message:
Code:
cannot run command `/bin/bash': No such file or directory
I tried copying /bin/bash to /tmp/somedir/, but the same error occurs. What's wrong with my chroot?
shell command to display contents of a file? Like that of .txt or .html
View 9 Replies View RelatedI frequently use wget to download tarballs and zip files from the web, then either untar then or gunzip them. I do:
Is there a way for me to automatically pass the zip file to tar or unzip WHILE wget-ting?
In pseudocode: wget google.com/somfile.zip && unzip
I need to trace the actions that are performed by my .cshrc file. Is there a command i can use to get a printout of this?
View 3 Replies View RelatedI'm relatively experienced with UNIX and Linux, but this has me thrown for quite a loop, and it seemed like such a simple question. How would I go about finding the newest file in a file system? I thought something like:
Code:
ls -ltr `find /usr -type f`
would work, but I seem to be exceeding the argument maximum for ls:
ksh: 0403-029 There is not enough memory available now
I thought something involving xargs might work, but I really suck with that command.
I'm used to being able to put a script in ~/bin and having it overrule the system version of a command. However for "time" or "kill" since the bash shell implements a version of the command (i.e. /bin/ version is not used) doing this is not enough. How can I get the shell to run my own version instead of the version in the shell.I understand the implications of doing this. I know what I'm doing, I can always /bin/whatever if I want to get the old version (or just chmod -x ~/bin/whatever).
View 6 Replies View RelatedSo I want to run command through ssh but also run a if check in bash to see ifa file exist. I know that to run ssh commands you do ssh user@server YOURCOMMANDbut if i need to run an if statements, how would this work??
View 4 Replies View RelatedI am writing a script in which I am using AWK to append to a line in a file and save the file. The command I am using is:
Code:
awk '{s=$0; if ( NR==4 ){s=s ":/usr/java/jdk1.6.0_19/bin" } print s;}' $appName > $appName.new
[code]...
I need to remove a large binary file(PDF file) from a large log file which is generated daily.This is seriously hogging space on our servers.I need to remove the large PDF from the logs to make the logs smaller and manageable
I need to take out the texts (or binary file) between the strings
<my:PDF> and </my:PDF>
<applicationForm> and </applicationForm>
<image> and </image>
<extractedSignature> and </extractedSignature>
I am not sure whether sed utility can do this, these are large files and need to be pruned .I am not seeking logrotation advice just a script or command that can strip these large logs of texts between the characters above . I am not sure how to do this.These files are rather large.I am not sure how to achieve this with sed , tail, head , tr or any other facility .
Bash shell could not find "kfontview" command, although kdebase-4.2.1-2.fc10.i386 already installed?
View 2 Replies View RelatedI have a command that outputs n lines of text, and I want to place each line into an array element, but I can't seem to get the syntax correct
So my command is this:
cat $configfile | sed -n '/cluster:'$clustername'/,/cluster/ p' | awk /host/
Which produces many lines depending on the value of $clustername. I'd like to get each line as elements of an array.
How can i write a shell script that takes a file path as command-line arguments.and it should report whether the path denotes a file or a directory.
View 2 Replies View RelatedI wonder if there is anyway to make a user-defined bash shell function global, meaning the function can be use in any bash shell scripts, interactively or not. This is what I attempted:
Code:
$ tail -n 3 /etc/bashrc
echotm () {
echo "[`date`] $@"
}
[code]....
I am trying to fix a perl script, and I really suck at perl. But I think this problem will be easy for people who know it.
The problem is, I have an old setup script someone wrote many years ago. It fails if the standard shell is dash and not bash. The only way I've gotten it to work is to point /bin/sh to bash. I looked thru the script and it uses "system" many places, and I think that's the problem.
I searched for it and found this link:url
My plan is to include this function:
Code:
sub system_bash {
my @args = ( "bash", "-c", shift );
system(@args);
}
Then I could simply change all calls to system into system_bash and it should work?
The parameter to the system calls is usually some variable. What if the parameter is a list already? Do I need to test for it somehow, and if it's a list, prepend "bash" and "-c" to the list? How do I do that?
In the script there are lots of places like this:
my $error = system($cmd);
if ($error) {
die/warn "some error message";
}
Shouldn't there be a return in the system_bash function?
Trying to create a small script that will read user's input, test if user entered some input and if not display some message or display a text using user's input.
The script is the following but i get an error saying "[: 6: =: argument expected"
Yesterday afternoon, I was playing around with updating my system with RPMs from the openSUSE RPM Search. I had bash v 4.0.18 (I'm running a decaboot, the primary OS being openSUSE 11.2, where the issue is) and I installed a package that was bash 1.0.36. I restarted my Yakuake terminal to see the new bash. Immediately, I noticed the Yakuake terminal flashing rapidly, and the terminal wouldn't go down when I used the key that brings up and down, so I controlled-alt-escaped it and killed it off. Then I wondered if it was just me, so I hit ALT-F2 and logged in as root. It quickly said some symbol file (Something)_(Something)_REWRITE(maybe) then disappeared, giving my the login prompt. I though, well, OK maybe I have to restart it to get it to work. Init said "there is no more processes left on this runlevel" and I had to Power-Button it and reboot. When it rebooted, or tried to, I was greeted with "KERNEL-PANIC Tried to kill init"
I panicked with the kernel, and I went into my 11.3 Milestone 4 installation, tried to chroot it, but I received the same error as when I tried to log into root and was returned to my 11.3 session.
I later tried to do a mock update with the 11.2 DVD, and tried with the YaST package manager to downgrade BASH, but the RPM installation failed, even on good DVDs. I tried the rescue, but it said BASH wasn't a "critical file" while things I don't even use were checked (like openssh)
From 11.3, I tried linking sh from bash to ksh (Korne Shell). For all I know, it is just like bash. It didn't work. Same kernel error.
I relinked sh and bash together, and I am using SUSE 11.1 in the meantime, but does anybody know how to fix this without reinstalling my SUSE 11.2 completely.
how come I can create a shell script file with two functions, I can execute the file, but when running declare -f, the functions are not on memory, and when invoking the function bash returns invalid. In the other hand, I can copy & paste the two functions at the end of my /etc/bashrc file.... then I can called the function by name.... and the commands within that function run on my session. here is a print of all my bash packets:
[Code]....
Does Fedora has restrictions on shell scripting? I haven't touch bash in seven years, so if things have change on it I'm behind on it, and sorry for my ignorance.
What options should I use when I'm using the sort command to sort the top 5 CPU processes (ps -eo user,pid,ppid,%cpu,%mem,fname | sort ??? | head -5) showing max to min usage?
View 2 Replies View RelatedI am trying to grep multiple numbers from file, grep does have the -f option for that.
Code: grep -f <`seq 500 520` /etc/passwd I know this could be done with
Code: for i in `seq 500 520`; do grep "$i" /etc/passwd; done But my question is fare more behind this example. It is possible to redirect one command output which will be treat as a content of file for another command ?
below are the details of my system. I have bash as my current shell, some really common commands aren't working.
Do I need to do a re-installation of bash? Or how do I install a selection of bash commands which I need? (for example a subset of [URL])
Code:
root@sdptfw:~ # uname -a
Linux sdptfw.sdpt.co.za 2.4.36 #1 Tue Jul 22 13:13:24 GMT 2008 i686 i686 i386 GNU/Linux
root@sdptfw:~ # echo $SHELL$
/bin/bash$
[Code]....
I want to change my default shell to tcsh. I used
Code:
usermod -s /bin/tcsh username
command as given at url
But if I open a new shell, it is still a bash shell.
How do I make my default shell as tcsh?
I used c-shell previously in unix. One of the useful command I used frequently is foreach.> foreach a (`cat list`)>> echo $a need to use bash shell now instead, and realized that I can't use foreach anymore. The command is not found. Does anyone knows if there is similar command / function in bash shell?
View 9 Replies View RelatedSo I open firefox from my bash shell with:
Code:
firefox google.ca
it opens firefox, I can browse, etc.
Now if I alt-tab back into my shell, i can't enter any commands in the shell.
I know that i can do this if I close firefox, but I want to keep working in my shell with firefox still open.
Is this possible?