10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Debian 9 64x - LXDE
How can i disable escape sequences in a variable?
#!/bin/bash
#mainscript
. "./links.bash"
echo "$red_start This text should be red $color_end"#!/bin/bash
#links.bash
#colors
red_start="\eOutput that i get:
\e
Output expected:
This text should be... (5 Replies)
Discussion started by: int3g3r
5 Replies
2. Shell Programming and Scripting
Hi all
I have a variable name as below
runbatch=FCSTworLOADfx_CYR
Now i need to search for FCST in this variable and run a program
I am doing like this but it is failing
if ; then ****RUN PROGRAM**
Please help
DJ
Please use CODE tags when displaying sample input,... (3 Replies)
Discussion started by: Hypesslearner
3 Replies
3. Shell Programming and Scripting
My variable is something like:
f="/Volumes/VERVE/MOOTON_CALL/01_shots/XX/xx0195/Projects/program/rs0195_v400001.aep"
I use ${f:63:6} to call "rs0195" as characters counted from the left, but it'd be so much easier to count from the right.
If ${f:95:10} counts from the left, what would... (2 Replies)
Discussion started by: scribling
2 Replies
4. Shell Programming and Scripting
I have a script with a $PASSWORD variable. I unset it right after using it, just to minimize the chance it could be left around for a snooper. That worked just fine... until I used a password with a value of "P@ssw0rd" Now, unset (even with -f, even with the variable enquoted) tells me: unset:... (1 Reply)
Discussion started by: jnojr
1 Replies
5. Shell Programming and Scripting
I am trying to store a string value to a temporary variable within my script. When I run the command manually it returns the expected value, but from the script an additional "\r" is at the end.
tCurrentStatus=`cat ${tPC_status} | grep 'Current status' | awk '{print $NF}'`
output:
cat... (1 Reply)
Discussion started by: jxrst
1 Replies
6. Shell Programming and Scripting
I need to cut the last seven characters of a variable length variable. The variable may be 7 characters or 70. I need to always be able to grab the last 7 characters. I looked at the cut command but it always seems to want to start at the beginning of a line, not the end and count backwards.
... (5 Replies)
Discussion started by: kblawson14
5 Replies
7. Shell Programming and Scripting
I'm using a shell script to get user input with this command:
read UserInput
I would then like to take the "UserInput" variable and strip out all of the following characters, regardless of where they appear in the variable or how many occurrences there are:
\/":|<>+=;,?*@
I'm not sure... (5 Replies)
Discussion started by: nrogers64
5 Replies
8. Shell Programming and Scripting
I have a variable var which contains "ABCDEFDH"
Now I have to remove the first 4 characters that is "ABCD"
so my variable should contain only "DEFH"
plzz tell me how to do that .
i am using bash shell (1 Reply)
Discussion started by: cynosure2009
1 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I have scenario as below,
I want to cut the characters and store it variable2.. and want to display the variable2.. as shown below...
eg: the size may differs , i am show just an example.....
numbers are not fixed in variable1..i want to extract characters and... (1 Reply)
Discussion started by: G.K.K
1 Replies
10. UNIX for Dummies Questions & Answers
Hi ,
I need to get the specified word from the variable.can some one help me out in this ?
input=ASD34567P
i need to get the value as :
output1=34567
So i need to ignore the last character and get the remaining values.
THANKS IN ADVANCE. (6 Replies)
Discussion started by: ithirak17
6 Replies