General :: Replaces Empty Spaces By Underscore?

Mar 11, 2011

my requirement is i need to copy mail subject to a text file and create one directory from the name of subject.

my MAIL subject is like this :

Quote:

Subject:Thanks to linuxquestions.org

i copied the mail subject to a file. and now the issue is to creating a directory.

now i want to create a directory without empty spaces, insted of space replace _ in that place.

i want out put like this.

Quote:

Thanks_to_linuxquestions.org

View 5 Replies


ADVERTISEMENT

General :: Shell - Rename A File From Something Without Spaces To Something Containing Spaces?

Jan 26, 2010

Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing:

mkdir "new dir" and:

touch "new file.txt"

I want to rename files from:

imgp0882.jpg to something like:

20091231 1243 some topic.jpg

And how would it look in a shell script that uses parameters like:

for i in *.jpg do
rename "$i" "$somepath/$mydate $mytime $mytopic$extension"
?

I'm new to Linux (using PCLinuxOS 2009.2), coming from Windows, and I've written myself a little shell script to download files from my camera and then automatically rename them according to a date-and-topic pattern. As you can guess by now, I'm stuck on the bit about renaming. If you want to see my script, here's a copy. I'm not using jhead for this renaming because that only works with JPEG files but I want a single solution for any media format including videos.

View 2 Replies View Related

General :: Using Underscore In File Names?

Apr 4, 2011

I use the command line frequently to navigate my files so I try not to have spaces in file names. Typically I have used an underscore to connect words but it was recently suggested that I should use a dash. Are there any disadvantages to using an underscore in file names?Should I switch to a dash? My system is running Xubuntu and I almost exclusively use the bash shell.

View 4 Replies View Related

General :: Concatenate Two Variables With Underscore?

Jun 4, 2010

I have question regarding concatenation of two variables with underscore.i.e. (bourne shell)

Code:
# var1=123
# var2=456

[code]...

View 3 Replies View Related

Debian Configuration :: Sid: Libreoffice Replaces Openoffice.org?

Mar 13, 2011

I have box that I run Sid on. I haven't used if for a month or so and have found that OpenOffice is gone and appears to have been replace by LibreOffice. I have come across one other thread which noted something similar. Is LibreOffice any better than OpenOffice? I plan to purge LibreOffice and install OpenOffice back on unless there is a good reason to keep LibreOffice.

View 14 Replies View Related

Ubuntu Installation :: Apt-get Failure / Error: Parsing Dependency Replaces?

May 12, 2010

As trying to update my system the other day I was greeted with a message I did not want.

Code:
tpsv@titantest:~$ sudo apt-get install update
Reading package lists... Error!
E: Problem parsing dependency Replaces
E: Error occurred while processing language-pack-kde-nds (NewVersion1)
E: Problem with MergeList /var/lib/apt/lists/us.archive.ubuntu.com_ubuntu_dists_karmic_main_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

View 3 Replies View Related

General :: Shell Scripting \ (test If A File Is Empty, If It Is Then Display "file Is Empty" Otherwise Display "file Is Not Empty")?

Oct 5, 2010

I am a final year student doign Computer systems engineering and just been introduced to linux. While still strugling to catch up with the commands, I am now given an assignment under shell scripting.I seriously am strugling to understand this question, can you please assist me.Here follows the assignment:

Operating Systems III
Some tips
e.g. (test if a file is empty, if it is then display "file is empty" otherwise display

[code]....

View 10 Replies View Related

Ubuntu Networking :: Network Manager Replaces Default Route When Eth Cable Plugged

May 5, 2010

I have been encountering this problem, not only on 10.4, but on older versions too: I use a wifi router to connect my laptop to the Internet, but sometimes I need to connect directly to another computer to move some files over GLAN. But Ubuntu's Network manager doesn't allow me to configure the eth0 interface without specifying a gateway (no gateway = grey submit button), but when a gateway is specified, it always rewrites the default gw specified already by the active wifi connection and returns back after unplugging the eth cable.

Of course this can be solved by a few route commands, but this is unacceptable since it is needed to establish the cable connection without any further assistance from within and as well without replacing the default gw and thus breaking the Internet connection. Is there, please, any possibility how to prevent Network Manager from replacing these routes?

View 2 Replies View Related

General :: Using Tilde And Spaces

May 26, 2010

I'm trying to use a tilde '~' for a filename. This works fine normally Code: rm ~/File
But when I have a file with a space in in and enclose it in quotes it takes it literally.If a word begins with an unquoted tilde character (�~�), all of the characters up to the first unquoted slash (or all characters, if there is no unquoted slash) are considered a tilde-prefix.

View 5 Replies View Related

General :: How To Kill A Process With Name Having Spaces

Dec 10, 2010

A process with name=example can be killed by killall -9 example

How to kill multiple instances of following command which contain spaces?

"valgrind --tool=lackey ./testcases/kernel/syscalls/waitpid/waitpid03"

Following command returns valgrind --tool=lackey ./testcases/kernel/syscalls/waitpid/waitpid03: No such file or directory

View 3 Replies View Related

General :: Replace Multiple Spaces By One Tab

Feb 2, 2011

Ive some textfiles which contains some colums seperated by a various number of spaces, but instead i need one single tab as a seperator.

View 5 Replies View Related

General :: Replacing A Line With Spaces?

Jan 5, 2011

I have a line like

port = 2566

I want to replace it as

port = 8080

how to do this in shell script. when i tried to do this with sed

sed -i 's/port=.*/port='$3'/' /root/$2

it is not recognizing spaces , it works only if line is port=2566 .

View 6 Replies View Related

General :: Running SCP Command With Spaces?

Jan 21, 2010

I am trying to run an scp command on my linux server, this is working fine, however I changed the output folder to one which has spaces and now when run, it's coming up saying SCP ambiguous target

Here's my string:
expect -c 'spawn scp -r /var/lib/asterisk/backups/Everyday/ administrator@192.1.1.1:
/Volumes/Data1/My Backup Folder/ ; expect assword ; send "MYPASSWORD " ; interact;'

View 4 Replies View Related

General :: Convert Tabs To Spaces In Many Files?

Jul 2, 2010

I have a lot of files with tabs littered throughout, and I'd like to convert them all into spaces. I know about the expand command, but unfortunately I would have to type out every single file using it. Is there any easier way to do this on Linux?

View 2 Replies View Related

General :: Bash Command To Remove Spaces

Sep 14, 2010

I am reading the output of /proc/acpi/thermal_zone/ATF0/temperature in a program to read my CPU temp. I am using cat like the following:

Code:
#cat /proc/acpi/thermal_zone/ATF0/temperature
temperature: 49 C

I basically want to get rid of the spaces in between temperature and the actual temperature. Is there a command I can pipe the cat output to, to remove the spaces. I have seen suggestions for sed, or tr, but for some reason I cannot get them to work properly.

View 14 Replies View Related

General :: Getting Blank Spaces In Shell Script?

May 7, 2010

I did the following script:

Code:

DIR=`pwd`;for i in `find . -name GESTION -type d`;do cd $i/..;setfacl -R -m g:directores:rwx,
GESTION;echo $DIR'/'$i;cd $DIR;done

This code do the following actions:

1. Starting inside a folder, it's searching for any folder called "GESTION"

2. Every time a folder called "GESTION" is found, then the script move to its parent folder, and then it applies ACL permissions to the folder GESTION by using the command setfacl.

The problem is that the script doesn't works when there was found a folder with a blank space in its name. I mean:

/dir1/dir2/dir3/GESTION --> this works fine
/dir1/dir2/dir 3/GESTION --> this doesn't works
/dir1/dir2/dir3/2. GESTION --> this doesn't works

View 4 Replies View Related

General :: Spaces In Command Line Switches

Oct 6, 2010

I am trying to encode files via mencoder. The file name has spaces in it. "test file.mkv". When I manually type the command in the terminal, everything works. But when I use a bash script (I'm reading it from a file) it doesn't. It gives me

Code:
File not found: '"test'
Below is the bash script I wrote

Code:
#!/bin/bash
# For testing, we have already built a file list, so just use that.
# ls *.mkv>files.lst
exec 10<files.lst
let count=0
while read -u 10 FILE; do
LINE="mencoder -of lavf -lavfopts format=mp4 -vf scale=1024:-3 -ovc x264 -x264encopts crf=28:vbv_maxrate=1500:nocabac:global_header:bframes=0 -oac faac -faacopts br=160:mpeg=4:object=2:raw -channels 2 -srate 48000 "$FILE" -o test.mp4"
echo $LINE
exec $LINE
done

exec 10>&-
files.lst contains only a single line (no newline) with
Code:
test file.mkv

On a related note, when I was first trying this simply on the command line, I had a file that had a double exclamation point. I found out that that is a shortcut of some kind for the previous command. My kludge to get around this was to try to execute a single exclamation point as a command, then to change the double exclamation point to a quadruple exclamation point. Is there a proper way (escape sequence or something) to pass double exclamation points to a command?

View 2 Replies View Related

General :: Ubuntu : Delete The Extra Spaces?

Jul 28, 2010

I want to ask a question regarding the terminal in ubuntu. When i deleted some lines in the config files for example, there will be those so-called extra spaces left after deleting and i can't seem to delete those spaces and 'pull' up the lines below. So, how to delete those extra spaces?

View 13 Replies View Related

General :: Access Files With Spaces From Command Line?

Mar 17, 2011

How do I access files with spaces from the command line?
for example I want to go to a file called "New File" and let's say is in Downloads/Books/(and here is the file)
how do I input the space since the command line doesn't recognize it?

View 2 Replies View Related

General :: Remove Spaces From Many File Names Under Cygwin?

Nov 22, 2010

I'm hoping that someone can help me, I need to remove spaces (not replace with underscores) from several thousand files on a system with cygwin.
Can I do this from the shell using rename or mv somehow?

View 4 Replies View Related

General :: Selectively Remove Blank Spaces From String?

Oct 7, 2009

need all spaces between two letters or a letter and a number exchanged for an underscore, but all spaces between a letter and other characters need to remain. One example for clarity:

Input:

force -- lamin 90 [label]
active A -- generation [label]

needed Output:

force -- lamin_90 [label]
active_A -- generation [label]

I tried solving this with sed but obviously s/ /_/g does not work, nor does any s/[a-zA-z0-9] [a-zA-z0-9]/[a-zA-z0-9]_[a-zA-z0-9]/g , because you just can't do this...

View 2 Replies View Related

General :: Bash - Rename Files With Spaces Using System Shell?

Jun 8, 2011

I named a number of files with spaces in them, and I want to replace the space with "_". However, every time I write a command in the shell with the file name (eg "Spring 2011"), the shell doesn't recognize the file or directory. What can I do about this? Is there any way to use the unicode character for a space?

View 5 Replies View Related

General :: Search A String Having Spaces / Slashes / Colons In Vi Editor

Feb 2, 2010

I need to seach a string containing

the substring of 'New Request object:'

and

the substring of '/0x2ab46b1f90' in vi editor,

how do I accomplish that?

View 7 Replies View Related

General :: Lyx: File Name Error The Directory Path To The Document Cannot Contain Spaces

Sep 9, 2009

trying to write my thesis in Lyx 1.6. It works fine on my windows laptop at home but Not on my work computer. The problem is, when i try to view it in pdflatex it comes with with: Lyx: file name error The directory path to the document cannot contain spaces

View 1 Replies View Related

General :: Find List Of Table Spaces In Oracle In Unix?

May 11, 2011

command to find list of table spaces in oracle in unix

View 1 Replies View Related

General :: .bashrc File Adds A Couple Of Tens Of Spaces To The Prompt?

Sep 3, 2010

I got myself a .bashrc file off the net. I checked it beforehand, didn't detect anything bad about it. One thing that's odd about it, is that several spaces are added to the terminal command line.Screenshot:Those spaces are not put there by me. The file can be found here: [URL]..

View 3 Replies View Related

Programming :: Command Replaces "abb" Substring?

Oct 6, 2010

Here's my question. This command replaces "abb" substring

Code:
echo abbc | sed "s/.*b//g"
And this command doesn't work (lazy regex):

[code]....

View 9 Replies View Related

Ubuntu :: Blinking Underscore While Booting?

May 14, 2011

My parents just upgraded from their 8+ year old desktop to a newer dell. The old one has XP on it and would barely run, lots of bloatware, viruses, etc.. I tried putting an ubuntu 10.10 disc to boot from it but the old desktop suddenly stopped recognizing mouse and keyboard input so I couldn't change the boot preferences. I took the hard drive out and plugged it into my desktop, copied all the useful files to my hard drive, then wiped it. I then installed ubuntu on the old -and now empty- hard drive by having it plugged into my computer.

I put the hard drive back in the old desktop and found that the keyboard now works. I can press F2 or F12 and change things around and whatnot. However, when I let it pass the screen that prompts me to press F2 or F12, it goes to a screen with a blinking underscore in the top left of the screen and gets stuck there.

what's causing it to get stuck on this screen?

View 5 Replies View Related

Ubuntu :: Only Black Screen With Underscore When Booting 10.04

Jan 11, 2011

I just installed Ubuntu 10.04.1 (desktop edition) on my netbook (NB200), the installation worked fine, but when i restart i get a black screen with a blinking underscore on the top left corner. I don't have any options as any key that i press is just printed on the screen. (This happened with every version that I tried so far, even the netbook remixes).

If I don't press anything for some minutes, Ubuntu is finally starting, but without showing the Ubuntu loading screen in the process, like it did when I tried it with the USB.

View 3 Replies View Related

Red Hat / Fedora :: Black Screen With The Flashing Underscore?

Feb 22, 2010

so I installed fedora 12 last night, everything was fine. Installed some things, moved music over, etc. (Dual booting with windows vista btw) So I install my graphics card driver, (ATI Radeon HD 3200) and I reboot. When I open the bootloader (I think thats what it is), It starts to boot, then just has a black screen with the flashing underscore. I can type and stuff but nothing happens.

View 6 Replies View Related







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