In shell scripting found "\n-" and don't know what is it for


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting In shell scripting found "\n-" and don't know what is it for
# 1  
Old 03-22-2017
In shell scripting found "\n-" and don't know what is it for

Working on UNIX shell scripting I found in env file the following
Code:
 export H1="\n- "
 echo "${H1} Waiting for dependencies of ${MONITOR_KEY} to be satisfied ..."  >> ${LOG}

What is in shell
Code:
 \n-

The new line character?

Thanks for contribution
# 2  
Old 03-22-2017
Some versions of echo on certain shells on certain systems will print a newline followed bij a minus sign and a space (in other versions it will print the 4 characters \n- )
This User Gave Thanks to Scrutinizer For This Post:
# 3  
Old 03-22-2017
\n- is a new-line followed by dash space when used in echo/printf (assuming echo supports \n).
You can always test the hypothesis by creating a "test harness" to mimic....
This User Gave Thanks to vgersh99 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. Shell Programming and Scripting

"Command not found" doing a while loop in bash/shell

i=0 numberofproducts=${#urls} #gets number of entries in array called "urls" numberofproductsminusone=`expr $numberofproducts - 1` #-subtract by one while do wget ${urls} i=$(( $i + 1 )) sleep 10 done I'm getting an error ./scrape: line 22: [0: command not found that... (3 Replies)
Discussion started by: phpchick
3 Replies

3. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

4. Shell Programming and Scripting

problem executing awk in shell "not found"

Hello, The INPUT file a.txt contains this a a a b b b I'm trying to execute this shell script from the Unix Command Line like this: ./k.sh a.txt > newfile.txt #!/usr/bin/sh infile="$1" awk '{print $0;}' < $infile I get this error message on the command line: (9 Replies)
Discussion started by: script_op2a
9 Replies

5. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

6. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

7. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

8. Shell Programming and Scripting

Need help in shell scripting "delete"

I would like to delete a complete line which have particular word., and along with next line For Eg: disk 491 5/0/1/1/0.116.23.19.0.1.7 sdisk CLAIMED DEVICE /dev/dsk/c107t1d7 /dev/rdsk/c107t1d7 I am able to delete complete line by matching that word "CLAIMED" by using this following... (4 Replies)
Discussion started by: prablr
4 Replies

9. UNIX for Dummies Questions & Answers

No utpmx entry: you must exec "login" from lowest level "shell"

Hi I have installed solaris 10 on an intel machine. Logged in as root. In CDE, i open terminal session, type login alex (normal user account) and password and i get this message No utpmx entry: you must exec "login" from lowest level "shell" :confused: What i want is: open various... (0 Replies)
Discussion started by: peterpan
0 Replies
Login or Register to Ask a Question