Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Not able to input \ backslash when vi editor Post 303026756 by snowfrost88 on Monday 3rd of December 2018 03:24:28 AM
Old 12-03-2018
Not able to input \ backslash when vi editor

Hi,
How do I input \ when I do a vi of my file ? I try to input the \ but it came out as @.
Appreciate any help.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a backslash to users' input

Hi, I need to convert user-input from '(this)' to '\(this\)' before passing it to egrep. I've tried using TR, SED and NAWK to add the backslash, but the most I ever get is a backslash without a '(' or ')'. Any ideas? Thanks! (13 Replies)
Discussion started by: netguy
13 Replies

2. UNIX for Dummies Questions & Answers

backslash issues

Hi, I have a script which looks through an input file and takes data from the file to use within the script. Everything works fine until the script reads the item \windows\directory\structure\ from the input file into a variable. As unix sees the backslash as an escape character, the... (5 Replies)
Discussion started by: Bab00shka
5 Replies

3. UNIX for Dummies Questions & Answers

Pasting text in VI editor from a different editor

Hi, I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question. How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'? As i see, p & P options does work only within 'vi'. (10 Replies)
Discussion started by: harishmitty
10 Replies

4. Shell Programming and Scripting

set EDITOR=vi -> default editor not setting for cron tab

Hi All, I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by set EDITOR=vi it does not open a vi editor , rather it do as below..... ///////////////////////////////////////////////////// $ set... (6 Replies)
Discussion started by: aarora_98
6 Replies

5. UNIX for Dummies Questions & Answers

Escaping backslash

I have a variable containt something like this, c:\mask\mask. How can I escape "\" in the values? I want the value as it it. (9 Replies)
Discussion started by: swmk
9 Replies

6. Solaris

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :Licen

Epic Editor was not able to obtain a license for your use. Feature Epic Editor :License server is down (1 Reply)
Discussion started by: durgaprasadr13
1 Replies

7. UNIX for Dummies Questions & Answers

./configure backslash questions

Hello all. I am going to try my hand at compiling tarballs rather than installing packages. I have a pretty good understanding of the process and have even compiled/installed Top from source. But that was an easy install, I want to try something more complex using the various configure... (6 Replies)
Discussion started by: RobertSubnet
6 Replies

8. UNIX for Dummies Questions & Answers

eval removes backslash

Hi, ============= In one of my config files, I have below command eval echo RECORDDELIMITER '\n' The above command results in removing backslash and outputs: RECORDDELIMITER n ============= Any workaround to retain the backslash after eval. Appreciated for your... (10 Replies)
Discussion started by: axes
10 Replies

9. Shell Programming and Scripting

Echo backslash

If I echo "\\" I get a backslash returned ~$ echo "\\" \ Why doesn't this work: string=`echo "\\"` echo $string I get the error message: bash: command substitution: line 1: unexpected EOF while looking for matching `"' bash: command substitution: line 2: syntax error: unexpected end... (2 Replies)
Discussion started by: locoroco
2 Replies

10. UNIX for Advanced & Expert Users

grep for a backslash question

Why does this work when grepping for a backslash? grep '\\' .bash_history grep "" .bash_historyWhy does this not work when grepping for a backslash? grep "\\" .bash_historyI know this works works but just don't understand why I need 4 backslashes when using double quotes. grep "\\\\"... (7 Replies)
Discussion started by: cokedude
7 Replies
ARRAY_SPLICE(3) 							 1							   ARRAY_SPLICE(3)

array_splice - Remove a portion of the array and replace it with something else

SYNOPSIS
array array_splice (array &$input, int $offset, [int $length], [mixed $replacement = array()]) DESCRIPTION
Removes the elements designated by $offset and $length from the $input array, and replaces them with the elements of the $replacement array, if supplied. Note that numeric keys in $input are not preserved. Note If $replacement is not an array, it will be typecast to one (i.e. (array) $parameter). This may result in unexpected behavior when using an object or NULL$replacement. PARAMETERS
o $input - The input array. o $offset - If $offset is positive then the start of removed portion is at that offset from the beginning of the $input array. If $offset is negative then it starts that far from the end of the $input array. o $length - If $length is omitted, removes everything from $offset to the end of the array. If $length is specified and is positive, then that many elements will be removed. If $length is specified and is negative then the end of the removed portion will be that many elements from the end of the array. If $length is specified and is zero, no elements will be removed. Tip: to remove everything from $offset to the end of the array when $replacement is also specified, use count($input) for $length. o $replacement - If $replacement array is specified, then the removed elements are replaced with elements from this array. If $offset and $length are such that nothing is removed, then the elements from the $replacement array are inserted in the place specified by the $offset. Note that keys in replacement array are not preserved. If $replacement is just one element it is not necessary to put array() around it, unless the element is an array itself, an object or NULL. RETURN VALUES
Returns the array consisting of the extracted elements. EXAMPLES
Example #1 array_splice(3) examples <?php $input = array("red", "green", "blue", "yellow"); array_splice($input, 2); // $input is now array("red", "green") $input = array("red", "green", "blue", "yellow"); array_splice($input, 1, -1); // $input is now array("red", "yellow") $input = array("red", "green", "blue", "yellow"); array_splice($input, 1, count($input), "orange"); // $input is now array("red", "orange") $input = array("red", "green", "blue", "yellow"); array_splice($input, -1, 1, array("black", "maroon")); // $input is now array("red", "green", // "blue", "black", "maroon") $input = array("red", "green", "blue", "yellow"); array_splice($input, 3, 0, "purple"); // $input is now array("red", "green", // "blue", "purple", "yellow"); ?> Example #2 array_splice(3) examples The following statements change the values of $input the same way: <?php array_push($input, $x, $y); array_splice($input, count($input), 0, array($x, $y)); array_pop($input); array_splice($input, -1); array_shift($input); array_splice($input, 0, 1); array_unshift($input, $x, $y); array_splice($input, 0, 0, array($x, $y)); $input[$x] = $y; // for arrays where key equals offset array_splice($input, $x, 1, $y); ?> SEE ALSO
array_slice(3), unset(3), array_merge(3). PHP Documentation Group ARRAY_SPLICE(3)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy