Sponsored Content
Full Discussion: Need to put semicolon
Top Forums Shell Programming and Scripting Need to put semicolon Post 302611177 by ygemici on Thursday 22nd of March 2012 11:06:13 AM
Old 03-22-2012
or try like this
Code:
# sed 's/../&:/g;s/.$//'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

put a semicolon at the end of each line of a file

hi, Consider there is a file containing 200 lines. please let me know which command is to be used to put a semicolon at the end of each line. if no single command is there then how it can be achieved. (1 Reply)
Discussion started by: surjyap
1 Replies

2. UNIX for Dummies Questions & Answers

wget with semicolon in page name

So, I'd like to wget a webpage, as its not going to stick around forever - but the problem is the webpage has a semicolon in it. wget http://example.com/stuff/asdf;asdf obviously doesn't get the right webpage. Any good way around this? (2 Replies)
Discussion started by: Julolidine
2 Replies

3. Shell Programming and Scripting

Replace a string after n semicolon every line

I have a file that is formatted in this way. a1;b2;c33;d4;e5;e;f;f;f;s d;ds;d;a;v;b;g;gr;r;rt;fdf s1;s2;s2;s3;s4; b1;f2;g3;h4;a3c4e;xcsd;fds; sd2;fs4;fs2;sdf3; I want to replace the value just before the 4th semicolon to empty string, regardless the value, such that it looks... (3 Replies)
Discussion started by: alienated
3 Replies

4. Shell Programming and Scripting

Delete lines after semicolon

char str; char str ; char *ptr; char * ptr; int CASE; int CASE; double temp; double temp; Output should be: char str; char *ptr; int CASE; double temp; How can i do this with awk,sed,perl? (5 Replies)
Discussion started by: cola
5 Replies

5. Shell Programming and Scripting

Adding semicolon at the end of each line

Hi, I have a script which I need to change. I want to add a semicolon at the end of each line where the line starts with "grant" for e.g. create table(.... ); grant select on TABL1 to USER1 grant select on TABL1 to USER2should become create table(.... ); grant select on TABL1 to... (3 Replies)
Discussion started by: pparthiv
3 Replies

6. UNIX for Dummies Questions & Answers

Delete a semicolon and numbers after a semicolon

I have this: ((9:0.010,(11:0.089,13:0.004)) and I would like this: ((A9,(A11,A13)) How do I delete the semi colon and the number (i.e. 0.010) after the semi colon? Also, how can I add the letter before the number that is NOT removed? Thank you in advance! ---------- Post updated... (4 Replies)
Discussion started by: MDeBiasse
4 Replies

7. Shell Programming and Scripting

Inserting semicolon at the end of a line

HI Am totally confused with sed and translate command command.. My problem is I have a file like # vi test.csv ABC_IMUY ERD0_FN VEG_NON_DES_IYT BUY4_FLOW POI_SHD_URDF_IYUT_REDS_CYC UYT_PMC4_WIND EX_FRE_FRD_L2_REF_FLICT JHY_SGT_DSE_L2 IYO_HYTR_FGT_L3_BGT_ICT... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies

8. Shell Programming and Scripting

How to have semicolon at the end of every line?

Hi, I wanted to create an automated script that will output a create table statement in unix. Below is the input and the desired output: INPUT: desc ZZ_APL_TIDDATELIST ( TID NUMBER AEX_DATE TIMESTAMP(6) ) desc ZZ_APL_TIDLIST ( TID NUMBER ) desc... (5 Replies)
Discussion started by: reignangel2003
5 Replies

9. Shell Programming and Scripting

How to use substr to extract character between two semicolon?

Dear folks Hello I have a data set which one of the column of this data set are string and I want to extract numbers which is between two ":". However, I know the substr command which will do this operation but my problem is the numbers between two ":" have different digits. this will make my... (11 Replies)
Discussion started by: sajmar
11 Replies

10. Shell Programming and Scripting

Replace semicolon within double quotes in a file with semicolon delimiter

Hello Team, Could you please help me with the below question? I have a file with the following properties 1) File Delimiter is ; 2) Text columns are within double quotes 3) Numeric columns will not have double quotes 4) File has total 6 columns Please see a sample record from file ... (3 Replies)
Discussion started by: sam99
3 Replies
SLSH(1) 																   SLSH(1)

NAME
slsh - Interpreter for S-Lang scripts SYNOPSIS
slsh [ --help ] [ --version ] [ -g ] [ -n ] [ --init file ] [ --no-readline ] [ -i ] [ -t ] [ -v ] [ -|script-file args... ] DESCRIPTION
slsh is a simple program for interpreting S-Lang scripts. It supports dynamic loading of S-Lang modules and includes a readline interface for interactive use. OPTIONS
--help Show a summary of options --version Show slsh version information -g Compile with debugging code, tracebacks, etc -n Don't load the personal initialization file --init file Use this file instead of ~/.slshrc --no-readline Do not use a readline interface for the interactive mode -i Force interactive mode. Normally slsh will go into interactive mode if both stdin and stdout are attached to a terminal. -t Normally, slsh will call slsh_main if it is defined. This option prevents that from happening making it useful for checking for syntax error. -v Show verbose loading messages. This is useful for seeing what files are being loaded. INITIALIZATION
Upon startup, the program will try to load slsh.rc as follows. If either SLSH_CONF_DIR or SLSH_LIB_DIR environment variables exist, then slsh will look look in the corresponding directories for slsh.rc. Otherwise it will look in: $(prefix)/etc/ (as specified in the Makefile) /usr/local/etc/ /usr/local/etc/slsh/ /etc/ /etc/slsh/ The slsh.rc file may load other files from slsh's library directory in the manner described below. Once slsh.rc has been loaded, slsh will load $HOME/.slshrc if present. Finally, it will load the script specified on the command line. If the name of the script is -, then it will be read from stdin. If the script name is not present, slsh will go into interactive mode and read input from the terminal. If the script is present and defines a function called slsh_main, that function will be called. LOADING FILES
When a script loads a file via the built-in evalfile function or the require function (autoloaded by slsh.rc), the file is searched for along the SLSH_PATH as specified in the Makefile. An alternate path may be specified by the SLSH_PATH environment variable. The search path may be queried and set during run time via the get_slang_load_path and set_slang_load_path functions, e.g., set_slang_load_path ("/home/bill/lib/slsh:/usr/share/slsh"); INTERACTIVE MODE
When slsh is invoked without a script or is given the -i command line argument, it will go into into interactive mode. In this mode, the user will be prompted for input. The program will leave this mode and exit if it sees an EOF (Ctrl-D) or the user exits by issuing the quit command. If an uncaught exception occurs during execution of a command, the error message will be shown and the user will be prompted for more input. Any objects left on the stack after a command will be printed and the stack cleared. This makes interactive mode useful as a calculator, e.g., slsh> 3*10; 30 slsh> x = [1:20]; slsh> sum (sin(x)-cos(x)); 0.458613 slsh> quit; Note that in this mode, variables are automatically declared. The interactive mode also supports command logging. Logging is enabled by the start_log function. The stop_log function will turn off logging. The default file where logging information will be written is slsh.log. An alternative may be specified as an optional argument to the start_log function: slsh> start_log; Logging input to slsh.log . . slsh> stop_log; slsh> start_log("foo.log"); Logging input to foo.log . . slsh> stop_log; slsh> start_log; Logging input to foo.log Similarly, the save_input function may be used to save the previous input to a specified file: slsh> save_input; Input saved to slsh.log slsh> save_input ("foo.log"); Input saved to foo.log As the above examples indicate, lines must end in a semicolon. This is a basic feature of the language and permits commands to span multi- ple lines, e.g., slsh> x = [ 1,2,3, 4,5,6]; slsh> sum(x); For convenience some users prefer that commands be automatically terminated with a semicolon. To have a semicolon silently appended to the end of an input line, put the following in $HOME/.slshrc file: #ifdef __INTERACTIVE__ slsh_append_semicolon (1); #endif The interactive mode also supports shell escapes. To pass a command to the shell, prefix it with !, e.g., slsh> !pwd /grandpa/d1/src/slang2/slsh slsh> !cd doc/tm slsh> !pwd /grandpa/d1/src/slang2/slsh/doc/tm Finally, the interactive mode supports a help and apropos function: slsh> apropos list apropos list ==> List_Type list_append list_delete . . slsh> help list_append list_append SYNOPSIS Append an object to a list USAGE list_append (List_Type, object, Int_Type nth) . . For convenience, the help and apropos functions do not require the syntactic constraints of the other functions. MISCELLANEOUS SCRIPTS
Several useful example scripts are located in $prefix/share/slsh/scripts/, where $prefix represents the slsh installation prefix (/usr, /usr/local,...). These scripts include: sldb A script that runs the S-Lang debugger. jpegsize Reports the size of a jpeg file. svnsh A shell for browsing an SVN repository. AUTHOR
The principal author of slsh is John E. Davis <jed@jedsoft.org>. The interactive mode was provided by Mike Noble <mnoble@space.mit.edu>. The S-Lang library upon which slsh is based is primarily the work of John E. Davis with help from many others. This manual page was originally written by Rafael Laboissiere <rafael@debian.org> for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL 06 May 2006 SLSH(1)
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy