General :: Bash - Get ' Quote ` Back-tic Through The Shell Into Sed?
Aug 3, 2011
In linux how do I to get the ascii decimal/hex/oct code from a char or a ascii char from a decimal/hex/oct code. I see from the gnu sed user manual that I can use the d# o# x# to specify a character but I am not sure how to use that. If some one has a better way to get the the ` and ' chars through I want to sed with the backtick '`' character and ''' single quote character.
sed '/`/p'
these don't work
sed '/'/p'
sed '/`/p'
View 3 Replies
ADVERTISEMENT
Jul 21, 2010
There is probably a very simple fix, but its wrecking my buzzI call the following on the command lineR CMD BATCH '--args Y_filename="one.txt" out="two.txt"' brew.RI want to call this from a bash script but replace one.txt with $1, and two.txt with $2 (ie the first two arguments from the command line)I have tried in vane"R CMD BATCH '--args Y_filename="$1" out="$2"' brew.R"
View 8 Replies
View Related
Feb 16, 2010
What's that bash command that automatically inserted a quote at the end of your email? Can't recall exactly, is floating round at the back of my mind.
View 4 Replies
View Related
Feb 19, 2010
I am having some weird problems with calling commands stored in a variable (I need to do this to assemble a command with a bunch of parameters automatically and then execute it).Example code that will replicate the weirdness:
$ echo "hello world" > "test file.txt"
$ cat "test file.txt"
hello world
[code]....
I would expect the output to be:
hello world
What happens to the quotes? I have tried various combinations of single quotes, escaped quotes, etc, but it seems like quotes in a variable are not evaluated as quotes when that variable is executed.
View 9 Replies
View Related
Jun 4, 2010
I need a shell script to back up and restore a postgresql database.
View 1 Replies
View Related
Mar 14, 2010
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?
View 6 Replies
View Related
Mar 25, 2010
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 Related
May 11, 2011
So 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?
View 6 Replies
View Related
Oct 6, 2010
Following script name is 123.sh and I need to put this in the background if I do 123.sh -bg this will not bring me back to the prompt but echoes what ever I put (using echo hello >> /tmp/123) in to the /temp/123 file. the only way that I have found doing this is to do "nohup 123.sh &" to put this in to the background. Is this okay or is there any better way of doing this?
#!/bin/bash
# file name is 123.sh
tail -f /temp/123 | while read line
[code]...
View 6 Replies
View Related
May 4, 2010
Is there a way to define an unlimited history in Bash ?
View 3 Replies
View Related
Aug 18, 2010
Possible Duplicate: Can history files be unified in bash? I have bash running in an ssh session, call this session A. I leave the office, go home, ssh to the same box, call this session B. From session B, I'd like to be able to look at the history of session A.
View 1 Replies
View Related
Oct 4, 2010
How can I get/filter history entries in a specific range?I have a large history file and frequently usehistory | grep somecommandNow, my memory is pretty bad and I also want to see what else I did around the time I entered the command.For now I do this:get match, say 4992 somecommand, then I do history | grep 49[0-9][0-9]this is usually good enough, but I would much rather do it more precisely, that is see commands from 4972 to 5012, that is 20 commands before and 20 after. I am wondering if there is an easier way? I suspect, a custom script is in order, but perhaps someone else has done something similar before.
View 2 Replies
View Related
Oct 26, 2010
Currently the terminal prompt looks like this:[karlis@karlis-desktop current_folder]$How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets?I checked the preferences for the default Gnome-Terminal and Terminator - there are no settings for this. It is pretty hard to use terminal when working in directories with long names.
View 1 Replies
View Related
Apr 12, 2011
I've written a bash shell script (code provided below) that gives the user 4 options. However I'm having a little trouble with the code. Right now when they select option 3, to show the date.It loops over and over again.I have to close the terminal window to stop it because it's an infinite loop. How would I prevent this? Also quit doesn't seem to be working either.
#!/bin/bashe
echo -n "Name please? "
read name
echo "Menu for $name[code]............
View 2 Replies
View Related
Feb 27, 2011
I am working on a simple script that should take two command line arguments, a [number] and a [name]. The first thing the script should do is check to make sure that no more and no less than two command line arguments have been entered when calling the script - an error message should be delivered if the condition is not true.
If two args have been entered, then the message 'processing "scriptname"' should appear, where scriptname is the name of the script being called. The script should then write to the screen "Hi [name]!", and should write this phrase [number] of times. For example, the command $ myscript 2 joe would produce the output: I have read the manual many times looking for examples, and I am very close by virtue of my own efforts. Further, I have searched these forums and others for good examples, which have also gotten me very close. Still my script is not completing the objective, and I am wondering if someone could point me in the right direction. Script:
[Code]...
View 13 Replies
View Related
Apr 30, 2011
i have a script where i need to pass an argument "1234:-)"if i run this as ./shell.sh 1234:-)it wont work because invalid character. i need to handle this with expect utility so if i pass it as ./shell.sh "1234:-)"no issue in bash but expect does not recognize this.
View 7 Replies
View Related
Dec 30, 2010
how do i use bash shell scripts inside php.I am just trying to call a simple cp command using php. Its not doing anything.
View 2 Replies
View Related
Jun 25, 2010
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
View 4 Replies
View Related
Mar 3, 2010
How can I move around the bash commandline efficiently?In the Windows prompt, one can go back or forward one word by pressing ctrl and <-/->.What's the equivalent in a bash environment?
View 1 Replies
View Related
Apr 11, 2010
In my bash file I have asked to navigate to some subdir, unzip a file and stay there but when I type pwd I can see i'm always back to home dir.Any way to get shell stick to subdir?
View 4 Replies
View Related
Apr 24, 2010
I just wonder the distinction calling the function between $(one_function) and one_function in bash shell script.
When I set the variable PS1 in ~/.bashrc, I can't invoke the function by one_func
ex:
export PS1="
[e[31m] $(one_func) # it works
export PS1="
[e[31m] one_func # it doesn't work
View 3 Replies
View Related
May 9, 2011
I am wondering is it possible to echo values like below described? The situation is - there are too many "doc" files named like "PLCI507_01234567.doc", and there is a Form in a text file named "form.txt" looks like below:
I am already able to create files in the same format for each documents but now I want all the information in a single form and the form should be updated with file informations ie. file name, created date, md5sum etc.
The updated form.txt should be like below.
View 2 Replies
View Related
Oct 4, 2009
I have a CentOS dedicated server running ProFTP. I have created user accounts which are meant for FTP access only but the users cannot connect to the FTP unless their shell access is /bin/bash
Here is an example line that is outputted when I use this command:
This user can access the FTP fine, but he can also access SSH which I don't want to allow him to do. If I set his shell access to /bin/false then he can't connect to the FTP.
What can I use in instead of /bin/bash to allow FTP but don't allow SSH?
View 2 Replies
View Related
Jun 21, 2010
I have a user that has been used for long time now that runs o C Shell... now there is a need to change it to Bash Shell? Can I cause a problem changing his shell from C to bash? I mean apps or variables?
View 2 Replies
View Related
Jan 21, 2010
I 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?
View 3 Replies
View Related
Mar 15, 2011
I would like to evaluate a postfix string using bash shell script,but I do not know how to start.
View 1 Replies
View Related
Sep 18, 2010
Any one tell me online bash login using putty [ssh port] for practicing a linux.
View 6 Replies
View Related
Jun 4, 2010
I do not know how to write either PYTHON or Bash Shell Scripting. I am to learn one for Linux Administration purpose. Which one will you recommend for a Linux Admin/Eng environment?
View 4 Replies
View Related
Jul 15, 2011
Today I faced a very strange issue while switching to root account in a bash shell.My OS : CentOS-5.1.4
I logged in my system with account name user1 and I open the terminal and below shell opens
[user1@localhost ]$
Now when I type su and want to switch to root account , it fails
[user1@localhost ~]$ su
Password:
su: incorrect password
[user1@localhost ~]$ exit
I know the password is 123 & I m 100% sure .
View 8 Replies
View Related
Nov 18, 2010
after i made the change to my shell type, that from SH to TCH, and back again, i lost my coloring for my file system, if you know what i mean, folders always come in blue, and devices in yellow hope you understand? now everything i do can't seem to differentiated between files colors anymore.
View 7 Replies
View Related