General :: Backslash Preceding A Shell Command

Mar 21, 2011

Reading a BASH script, I saw a find command preceded with a backslash. It was similar to this:

Code:
`find . -type f -name '*.xml' -print > xmlfilelist`

It's impossible to find documentation about this in man pages or on the internet, since 'backslash' are always evoked along with special characters. I also noticed that even though the command was surrounded with backquotes, the result was not affected to any variable. Maybe the backslash's presence is related with this?

View 2 Replies


ADVERTISEMENT

Programming :: Sed Bash Command - Not Print Backslash In Perl

Jul 11, 2010

This pretend to be a script for rename a lot of files automatically. So I put the list of files in an array named @lista. But, as you can see, at the end of the command I use a sed filter to print out a backslash for those files that have spaces in their names, so the path for those files could be rightly interpreted.

But there's no way I could print a backslash. It works well when I use the Perl's sed substitution s///, but I need every path in the array to be fixed.

I'd like to add that the bash command works perfectly well alone. I mean outside the Perl script.

This is de command line with the sed filter:

Code:

And this is what it brings:

Code:

View 12 Replies View Related

General :: Ubuntu Incorrectly Maps Backslash And Pipe Keys?

Mar 7, 2011

I am having what I think is a slightly weird problem with the way some of my keys on my keyboard are mapped. When I try entering the "backslash" keys i get < and for the pipe key i get >. I have tried going through the keyboard layouts and trying other combinations but to no avail

System info
ASUS G51VX
Keyboard: Standard
Ubuntu 10.04 LTS the Lucid Lynx - released in April 2010 and supported until April 2013.

View 5 Replies View Related

Programming :: Using Sed To Remove Preceding And Trailing Spaces In CSV?

Sep 16, 2010

the preceding and trailing spaces around the commas in my CSV without destroying my address field. I'm new to regex and sed so this is probably easy but I just can't do it without destroying the Address section. I'm using vanilla Linux and sed 4.1.3I'm willing to use any regex or even awk if needed.

Example:
I need this
randall , dean, 11111 , 1309 Hillside Ave., Warsaw, VA , 23591

[code]....

View 11 Replies View Related

General :: Run A Shell Command With &?

Jun 15, 2010

I am using Red Hat Linux Enterprise version 5. I've noticed people sometimes running commands with a couple of & options. For example, in the below command, there are two & signs. What is the purpose of them? Are they always used together with nohup?

nohup foo.sh <script parameters> >& <log_file_name> &

View 6 Replies View Related

General :: Looking For System Shell Command?

May 31, 2011

I'm looking for a specific command,if it exist... i want to login from my server to another Linux server,but the question is: can i do it in a one line command for ex:
usually you type: ssh "user"@10.1.1.1 and then the password,but I'm looking for a command in one line a fake ex: ssh user@10.1.1.1 -p "password" something like that.
I don't know if anyone of you understand what do i want to say .

View 6 Replies View Related

General :: Shell Command To Let System Box Go Sleep?

Jun 21, 2010

I'm writing a shell script to check the I/O activity of a Linux box and if the server is quiet for a certain long time, the script should let the server go to sleep. But, after some Google searching, I didn't find a answer yet. Is there a shell script command to put a Linux box to sleep?

View 3 Replies View Related

General :: Executing A Shell Command In Emacs?

Dec 17, 2010

I tried to execute a shell command by M-! cmd RET but it did not work.M-! does not turn up in the microbuffer no matter how many times I press Alt+!.But if I go to Tools menu and select Shell Command... option then it writes M-! to the microbuffer and everything works fine.What is the problem here?

View 2 Replies View Related

General :: Triming Lines Using Shell Command?

Mar 22, 2011

i have a text file generated automatically from a script , but the result in the script is not ordered in a readable way, so i need your help to fix it using a shell command the text file contain data in this way :

Code:

0.147361 0.243688 0.081520 -0.446603 1.130529 NC_000846 Chordata
Rheiformes
Aves
0.091740 0.379224 0.021160 -0.088493 3.441356 NC_000857 Arthropoda
Diptera

[code]....

i want to arrange the data in this text file in a way that each line will concatenate the 2 lines after it , so that will be 1 line , i want all the lines to be treated in this way ,

View 2 Replies View Related

General :: Create The Shell Which Would Support The LS Command In C++?

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And any way to change the command prompt.

View 1 Replies View Related

General :: Creating A Shell Using C Which Could Implement LS Command

Sep 4, 2010

I would like to create the shell which would support the LS command in C++. And the way the command prompt can be changed.

View 7 Replies View Related

General :: Shell Command To Display Contents Of A File?

Feb 23, 2010

shell command to display contents of a file? Like that of .txt or .html

View 9 Replies View Related

General :: Pipe Output Of Shell Command Into A New Buffer In Vim?

Jun 29, 2010

How can I pipe the output of a shell command into a new buffer in Vim? The following obviously wouldn't work, but you can see what I'm getting at:

:!echo % | :newtab

View 2 Replies View Related

General :: Make A Shell - Using Mail Command DestMail= Cat

Jul 22, 2011

I have a problem to make a shell, using mail command DestMail= cat /opt/scripts/maillist.txt mail -s"SUBJECT" $DestMail -- -r xxxxx@gmail.com < /opt/scripts/test.txt where: maillist.txt contain email adresse separated by comma test.txt mail text this script can eval DestMail variable!!

View 1 Replies View Related

General :: Want Shell Command Amount Space In Disk For Mp3

Jun 25, 2010

We use a SLES 10 SP2 file server. This file server has all type of files. We want to know what is the amount of space used by mp3 files. What we need to know is the total space in disk of mp3 files. I've been testing du command, and find command, but with no satisfactory results. Does anybody know how to do this?

View 11 Replies View Related

General :: 'cd' Command Increases Size Of Shell Propmt?

Sep 10, 2010

When i change the directory using 'cd', the length of my shell prompt keeps on increasing. To make it more clear kindly see below

Code:
$> cd MyWorks
$ Myworks> cd Shell

[code]....

View 8 Replies View Related

General :: Clear Screen Command For BASH Shell

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

General :: Use Ssh And Run Command In The Remote Machine Using Shell Script?

Apr 27, 2011

How can i do that.. Today is my first day writing a script.. and correct me if this Thread should be somewhere else..

Code:

if [ $1=$anyvariable ]; then
ssh www.a.com <Have to set few variables and give commands >

View 8 Replies View Related

General :: How To Visit URL Using Shell Script Or Unix Command

Aug 2, 2011

I want to visit a url but this shall be invoked by a shell script. Anyone let me know the command to hit a url in unix.

View 5 Replies View Related

General :: Building Application In Shell Using Make Command

May 26, 2011

Consider that I am building my application in Linux shell using make command but somehow the build fails. Is there any way I can find out that the build has failed (of course looking at shell for error messages will do the job for me but I don't want that). Is there any flag make or shell will set/reset if such failure occurs ?

View 5 Replies View Related

General :: Shell Scripting: Parse Parameters From Command Line?

Mar 12, 2010

myscript [-a a-arg] [-c c-arg] [-b] [-e] somedirectory

Given that I want my shell script be invoked at the command line using the above parameters - where [these brackets] denote that they are optional - what is the best method to parse them?

View 1 Replies View Related

General :: Send With Ftp Files From Computer1 To Computer2 (shell Command)?

Jun 29, 2010

I have 2 computers with linux, How can i send with ftp files from computer1 to computer2 them(shell command)? Steps that i think should be done (miss shell commands): find inner ip of computer1 open the ftp port (21) of computer1 (make computer1 ftp server) send file from computer2 to computer1 with shell command

View 2 Replies View Related

General :: Shell - Connect From Command Line To FTP Server With Proxy?

Aug 15, 2011

I want to connect to an FTP server from the Linux command line. The server is configured behind a proxy.

If I call:

echo $ftp_proxy

I get a result like this:

abc.def.ghi.jkl:8080

If I call:

ftp -pn $ftp_proxy

I get a unknown host error.

How can I connect to the FTP server using the Linux command line?

View 1 Replies View Related

General :: Debugger For Shell Script - Get Rid Of Multiple Exit Command ?

Jun 14, 2010

My two doubts:

(i) In office i open many terminal windows when i start my day and in each terminal i keep on login as different users many times in a day to do some task, by the end of the day when i need to exit from all terminals in a safeway instead of directly closing it i need to execute exit command or CTRL+D many times to close a single terminal safely. Can anybody tell me a way to exit from each terminal in single go, is there any command to acheive this ? I wish if we had a command like exitall like in vi we have :qa command to close multiple files opened in single window. I hope friends you have got what i am asking for ?

(ii) I want a software for debugging shellscripts searched a lot but dint got it.

View 7 Replies View Related

General :: Shell Command To Find Newest File In Filesystem?

Apr 13, 2010

I'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.

View 3 Replies View Related

General :: Udp Tcp Command Line Tool For Shell Script Programing

Feb 8, 2011

I am looking for a powerful command line tool to send and receive data via socket I mean define IP , port and data other options for command to send and receive data from sender.(like a high level socket programming)

View 4 Replies View Related

General :: Load A GTK 2.x Theme With Command Line / Shell Script?

Jul 18, 2010

I would like to know how i can load a gtk theme with a terminal command line or with a shell script if possible.

View 14 Replies View Related

General :: Referance To The Bash Shell / Use The Test Command To Evaluate?

Nov 8, 2010

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 Related

General :: Shell Command Equivalent To (Ctrl+C) To Exit From A Process?

Apr 1, 2011

I write a script to read a file which is something like a pipe (or) queue , which shows the running status.In normal case, if i open this file with cat command, i have to use ctrl+c to exit this . What command shall i use to do the same inside a shell script ? I have tried ^C in my script , but it does not exit the process.

View 6 Replies View Related

General :: Command Line - Get Relative Path From Two Absolute Paths In Shell?

May 13, 2010

We have two paths. First one is directory, second either dir or file.

/a/b/c and /a/d/e.txt

Relative path from first path to second will be: ../../d/e.txt

How to get it in linux terminal?

PS: For those who ask "what is use case?" - creating lots of relative symlinks (just as an example)

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved