The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
3answers
67 views

Trim a specific field and replace in Unix Shell Script

I have a file with below data: 5773|2015-11-19|2016418|O|2015-11-06|C|AB1CD|826|826|CDE|2015-11-19|22222222222222222222222222222|ABCD|AB|30 ...
0
votes
1answer
31 views

my home directory appears in my download directory

In my Downloads folder when I run ls I see the home directory, and I don't know why, I want to remove it but I am afraid to remove my home folder. Can anyone tell me how I can just remove the home ...
4
votes
4answers
145 views

Rename folder with odd characters

I have a folder on my Mac called "␀␀␀␀HFS+ Private Data". I'm trying to delete it but it contains a bunch of odd characters that are choking unlink, rm and mv, making it difficult to remove it and ...
3
votes
2answers
41 views

How to interpret ' character in a string passed through SSH

New to BASH and Linux and need some quick help. I have written a quick bash script that asks the user for a username and password from the command line and passes that info to a remote server later ...
1
vote
3answers
72 views

Sed command with ' special character [closed]

I am trying to execute the following command from bash shell: sed -i "s/\(update.*\)where /\1 where primary_id = '$primary_id', /" *.php As you see, there is a variable which I am inserting using ...
3
votes
2answers
47 views

What are these rectangular characters and where is this notation defined

Using Linux (Fedora, specifically) as my primary workstation, I noticed, at times, strange non-printable characters like in the following screenshots (bottom-left in the first image and upper-left in ...
0
votes
1answer
17 views

Listing a file with strange characters on DD-WRT embedded Linux

When SSHing into my DD-WRT router (Buffalo WHR-HP-G54) with embedded Linux to browse the DHCP Lease list I get strange characters: ~ # more /tmp/udhcpd.leases x▒_▒▒ ▒▒iPhone-de-Tomaz▒ ...
3
votes
1answer
30 views

Replace a control character with another control character

A csv file is being generated with a form feed (\f) character. This makes it hard to read in excel, etc. How can I convert the form feed character into a newline (\n) character? All my searches so ...
1
vote
1answer
144 views

bash set variable with colon (:) and dash (-) in it (as used by lftp)

so lftp uses some weird shell variables, like the following: xfer:log-file = 1 sftp:connect-program = “ssh -a -x -i keyfile” how would I set these variables? I've tried using set, and env; as well ...
1
vote
2answers
70 views

Makefile shell ignoring sed regexp end of line

I have a folder for various testing of C code, containing many files named *.c. My aim is to have a Makefile search for any filename ending in .c and add the root of that filename to the targets. ...
6
votes
2answers
225 views

How to display control characters (^C, ^D, ^[, …) differently in the shell

When you type control characters in the shell they get displayed using what is called "caret notation". Escape for example gets written as ^[ in caret notation. I like to customize my bash shell to ...
1
vote
0answers
30 views

“render” textfile with carriage returns (^M) and save output to file

I have a Python CLI program that runs for a long time and has a sort of progressbar, which basically prints some text in the loop without "\n" at the end, at the next iteration it prints "\r" to erase ...
0
votes
3answers
70 views

sed command not replacing a text with newline character

The Unix sed command doesn't recognize a backslash escaped n \n as a newline character. For instance, the command sed "s!,!\n!g" is replacing commas in the input text with the letter n and not a ...
3
votes
2answers
76 views

How can I remove files which contain special characters and Latin-1 characters?

I have 2 files in a directory named App on my Ubuntu mahcine. I want to remove those 2 files completely from that directory, but when I try to remove them using rm -rf, they are not deleted. I can't ...
0
votes
2answers
103 views

How to catch carriage return / line feed in case statement

I tried the following to no avail and couldn't find any documentation. read Option case $Option in [1] ) echo "1" ;; [2] ) echo "2" ;; [$'\n'] ) echo "LF" ;; [0] ) exit ;; * ) ...
3
votes
5answers
335 views

How can I get the raw formatting output of commands?

I'd like to know which control sequences are sent to bash by programs to format their outputs. For example, if I dump man less I can discern which parts are bold or underlined. ...
16
votes
2answers
879 views

What does CTRL+4 (and CTRL+\) do in bash?

I just found out by accident that CTRL + 4 closes programs reading stdin input from the command-line. This is how it looks when I type CTRL + 4 or CTRL + / into programs reading stdin ryvnf:~$ ...
0
votes
2answers
44 views

Putting a single quote in a filename [duplicate]

We can a make a directory named $"dollars"&<>\dogs if we surround it with single quotes like the following mkdir '$"dollars"&<>\dogs' However, what if I want to include a ...
2
votes
2answers
80 views

What other special characters are there?

For filenames, I know that you have to use either a double quotes or a backslash to include a space in your file name. Like mkdir "I like coffee" is the same as mkdir I\ like\ coffee Now when you ...
1
vote
2answers
173 views

How tp Print/echo arrow key in unix - bash, version 3.2.52

How do I print ↑ and ↓ in Unix? Basically I have a script written in bash and I am printing some numbers with whom I want to print arrow keys to show increase/decrease. So how do I literally print ...
3
votes
2answers
3k views

Search and replace control characters (^@, ^M, ^I…) in vi

I copied this line from /proc/some_proc_id/cmdline in my ubuntu machine, java^@-jar^@/usr/lib/selenium/selenium-server-standalone.jar^@-port^@4444^@-trustAllSSLCertificates^@ Somehow, the space ...
2
votes
3answers
279 views

Garbage in bash session log file. (using script command)

I tried to log bash session using: js:/var/tmp # script -aqf /var/tmp/out In out file I see, besides output, a lot of garbage. Instead of just whitespaces and new lines I see this, for example: ...
1
vote
3answers
45 views

Order of text jumbled when printing

We run an automated process which changes the data structure in a file, and it has run for about a year without any issues. It has just started failing and I have narrowed the problem down to one of ...
1
vote
1answer
134 views

TTY control characters sent to stdin of sh doesn't work

I tried to develop a remote app that launches sh and resends an incoming data there, and found that some special sequences don't work. So, for testing purposes, I launched on my desktop sh, then ...
3
votes
2answers
419 views

How to skip special / socket files during rsync transfer?

Using the following command. rsync --archive --delete --partial --progress --recursive --no-links --no-devices --quiet source target Using --no-links and --no-devices already. Getting the error ...
21
votes
5answers
1k views

How can I find the common name for a particular glyph?

Sometimes, I'd like to know the name of a glyph. For example, if I see −, I may want to know if it's a hyphen -, an en-dash –, an em-dash —, or a minus symbol −. Is there a way that I can copy-paste ...
0
votes
2answers
79 views

non-breaking space sometimes appears in Geany (my standard text editor)

I use Geany for all my coding, in my linux Mint-MATE install. Occasionally, i have a problem where a non-breaking space (char code 194) is present instead of a normal space character (32). This just ...
0
votes
3answers
4k views

Remove special characters in a text file

I have a text file which contains in each line a sql query. For each line, I need to remove some special characters. Expl: if I have: select * from Users; insert into Users values ...
1
vote
5answers
90 views

keep out line break

I have some files with this structure: 2015-03-25 17:08:17 sysUpTimeInstance 93474;^M 1.ValueforState=2500 I want to replace the line break, and leave the third line with the second line, I mean, ...
5
votes
1answer
174 views

using ! character in echo

I am messing with echo and having issues with echo displaying the ! character. I tried this. echo -e "Wake!\nUp! bash: !\n!: event not found Then this # echo "Wake\!\nUp!" Wake\! Up! Well now ...
0
votes
2answers
429 views

Why can't I kill the shell using the PID obtained from the $$ special variable? [duplicate]

After I have learned that the $$ special variable holds the process number of the shell, I tried too kill the shell by simply: kill , however this did not work, I also tried some variations, but them ...
1
vote
2answers
354 views

Remove control characters from /var/log/boot.log

I have a script that sends out email to sysadmin group when a server is powered on or off. The email contains dump of some important logs like /var/log/messages, /var/log/secure, /var/log/boot.log . ...
5
votes
1answer
212 views

Representing/quoting NUL on the command line

Can \0 be used on the command line? Background For testing corner cases in GNU Parallel I was curious whether all characters were correctly quoted on the command line. Most of them are: perl -e ...
26
votes
8answers
2k views

Dealing with file names with special first characters (ex. ♫)

I have recently come across a file whose name begins with the character '♫'. I wanted to copy this file, feed it into ffmpeg, and reference it in various other ways in the terminal. I usually ...
0
votes
2answers
295 views

How to printf an exclamation point in tcsh?

What's the best way to printf an exclamation point in tcsh? It seems like using single or double quotes has no effect on escaping the exclamation point; and using a backspace does work, but then it ...
4
votes
2answers
873 views

How can I write a non-breaking space? [closed]

When I write a question, I'd like the space between the final word and the question mark to be non-breaking, and this very sentence is an example of it (this is why it is awkward), how can I do that ? ...
6
votes
2answers
218 views

How many commands can be queued up with control operators?

I have been reading up on control operators, and I was wondering if there was a limit to how many commands you could line up with control operators, such as ||, && and ;. In addition, is ...
-1
votes
0answers
24 views

replace $ with £ using sed command [duplicate]

I have text file DollarToPound.txt with some Dollar signs ($) please provide a shell script to replace dollar symbol with Pound(£) with sed command. iam getting command garbled error!!! please help. ...
1
vote
1answer
97 views

Forcing the system to allow me to insert any character in the file name

I had an exam this week, and one of the questions was (with one correct answer): The file name can contain the character: a) \ b) / c) ? d) ! I chose c) ? because it looked ...
1
vote
2answers
687 views

printing special characters in awk output

I have a large file that contains lot MQ messages with RFH2 header. Each message in the file is separated by a blank line. Now I need to split this large file into small files each containing single ...
2
votes
1answer
335 views

csplit not obeying backslash r \r as carriage return

I have a file with \r\n line endings (CRLF carriage return line feed). This command works: $ csplit --silent --prefix=email-emailbad.txt- \ --digits=3 emailbad.txt '/^\.^M/'+1 '{*}' This ...
2
votes
1answer
371 views

What is the ` character or symbol called and what is its significance outside of SE code formatting? [duplicate]

What is the ` character's name and what is its significance outside of SE code formatting because I cannot get it to work? I'm familiar with its use in the Stack Exchange forums used to format code ...
11
votes
7answers
4k views

What is the symbol *.* called?

What's the name for the *.* symbol and what is its significance?
2
votes
2answers
573 views

How to rename filename with ' or ? in file name?

I have a problem renaming a file that I'm not even sure which special characters I have in the file. I'm using CentOS 6 64bit. When I ls the file: Giko Suzo San?e - Ep1.avi but when view it in ...
2
votes
2answers
247 views

Very strange ls > textfile problem when viewing with emacs

I want to list the components of the current working directory in a text file ls -1 > textfile Output looks fine with more. 1010661085645 1010729039145 1010747080245 1010849051345 ...
1
vote
1answer
864 views

Sed: search and replace a patten with special characters which has a arbitrary string in between

I have a load of nfo files which I want to make some global substitutions for some values within each file e.g. a.nfo has the value <set>Tonight&apos;s Menu ( June 2012 )</set> ...
2
votes
2answers
806 views

delete directory with special character in filename

I have these tricky directories that I can't figure out how to delete. If I run ls -ld * I get… drwxrwxr-x 7 user1 taskfmri 2048 Jan 22 15:26 857263 drwxrwx--- 4 user2 ...
4
votes
3answers
2k views

Help Shell script to pass variables to rsync

I'm trying to create a simple wrapper shell script for rsync. When I send file names to my script, rsync can never seem to identify the correct location. The file names have spaces in them. I've tried ...
5
votes
5answers
1k views

What are the special characters to print from a script to move the cursor?

I found that by printing \r from a script the cursor moves to the beginning of the line. What character will move the cursor up one line? Where is a list of these special characters? EDIT: Working ...
1
vote
1answer
142 views

What's the practical difference between `command` and $(command)? [duplicate]

Both give the output of the command, so what is the semantic difference between the two? Some reading led me to suspect is that $(command) is Bash syntax, and the back quotes are integrated into Unix ...