Sponsored Content
Full Discussion: Running sed commands
Top Forums Shell Programming and Scripting Running sed commands Post 302389842 by Dolph on Tuesday 26th of January 2010 06:10:53 AM
Old 01-26-2010
Running sed commands

Hello

I need to run some sed commands but it involves "/" in the substitute or delete, any ideas how I get round the problem.
Example:

cat file1.txt | sed -e '/</Header>/d' > file2.txt

This errors due to the forward slash before the Header text.

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

running start up commands

Hi all How can I setup my shell so that I run a set of commmands or a script every time I login. I am using kshell. I tried putting a line in ./.bash_profile (does not work) Ex.: I want to use vi as the commandline editor so, I want to run the command: set -o vi (3 Replies)
Discussion started by: skotapal
3 Replies

2. Shell Programming and Scripting

running commands from script

I'm new to unix and I have a fairly simple problem: Lets say I am in a specific directory and I run the command: "dirs" , I get an output of all the folders that i pushed into the stack (as expected), buut, when when I create a script (called test): #! /bin/csh dirs and then i run:... (2 Replies)
Discussion started by: owijust
2 Replies

3. Shell Programming and Scripting

How to disable running commands from vi

Hello, We have a requirement to disable running shell commands via vi using "!". Can anybody please suggest how to disable this option. The requirement arises because we open up a xterm window with a config file in vi mode for the customer to edit. After the customer edits the config... (1 Reply)
Discussion started by: Umesh_Sharoff
1 Replies

4. Shell Programming and Scripting

running commands from outside of bash

Hello all! I have two consoles.I know the PID of these two.Now I want to execute a command in console#1 but from console#2. How can I achieve this? Anyone can do something for my query? Click here if you can't understand my query or to know the need for this query. (3 Replies)
Discussion started by: rakabarp
3 Replies

5. Programming

Running UNIX Commands from C

Hi, -How can I get number of files, cpu usage (percentage), memory usage, disk usage, ...etc, using C program ... I can use unix command ( system(command) )but I want the value to be returned back to my C program to use it in my code? How can I do that? Thanks in advance ... (2 Replies)
Discussion started by: zainab
2 Replies

6. UNIX for Dummies Questions & Answers

Running two commands in one line

hi! how do i run 2 command from the same line e.g: 'which screen' and then ls -la 'which screen' (4 Replies)
Discussion started by: rdns
4 Replies

7. Shell Programming and Scripting

For loop and running 2 commands at once?

HI. I am trying to run 2 commands, using the "for x in a b c d" loop but i am having a hard time coding it... Here is what i have so far: for SERVER in SERVERA SERVERB SERVERC SERVERD SERVERE do ############################################################################### #... (5 Replies)
Discussion started by: Stephan
5 Replies

8. Shell Programming and Scripting

Code for running commands one after other

I need an if code in shell script where it should continue to further commands after succesfully installing the executable file. i.e. /run installer is continuing but in the middle it executes further commands like "cp /root/user which were given after /run installer. I want /runinstaller... (16 Replies)
Discussion started by: sriki32
16 Replies

9. UNIX for Dummies Questions & Answers

Echo out running commands

Is there any way in a script to print out the commands being ran? In DOS script, there is the "@echo on" and "@echo off". so I have a script like this: #!/bin/ksh echo "hello there. moving files." <turn on echoing here> cp thisfile.txt thatfile.txt cp whatfile.prop whyfile.prop <turn... (2 Replies)
Discussion started by: ronron5477
2 Replies

10. Shell Programming and Scripting

Running commands in backgroud

I have a small question may be this will be discussed before I have two files file1 and file2 with huge data and I am running the commands as cat file1 |sort & cat file2 |sort & If the session is got disconnected or logout will this command run in background, or shall we use nohup (3 Replies)
Discussion started by: morbid_angel
3 Replies
NANOBLOGGER(1)							   User Commands						    NANOBLOGGER(1)

NAME
NanoBlogger - small weblog engine for the UNIX command line SYPNOSIS
nb [-b blog_dir] [options] DESCRIPTION
NanoBlogger User's manual. NanoBlogger is a small weblog engine written in Bash for the command line. It uses common unix tools, such as cat, grep and sed. It's free to use and modify under the GNU General Public License. OPTIONS
-a, --add create new entry, category, or weblog (directory). -b, --blogdir <directory> specify weblog directory. -B, --body <text> deprecated, please use '-T' or '--text' instead. -c, --category <ID,cat> specify category (for '--add', '--delete', '--edit', '--list', '--update', and '--update-cache'). --cfgfile <file> specify an alternate configuration file. --configure configure weblog (for '--update'). --datadir <directory> specify weblog's data directory. -d, --delete <ID,cat> delete an entry or category. -D, --desc <text> set text of description (for '--add', '--draft', '--makefile' and '--makepage'). -e, --edit <ID,cat> edit an entry or category. -E, --draft <file> edit or create metafile. -f, --file <file> specify metafile to import as entry (for '--add'). -h, --help show this help message. -i, --interactive <1=on/0=off> toggle interactive mode (for '--add', '--delete', '--preview', '--publish', and '--update'). -l, --list <all,cat,DATE,max> list entries or categories (defaults to max). --manual view the manual. -m, --move <ID> move an entry to a specified category (for '--category'). -M, --makepage <file1> <file2> create new weblog page (file2) from metafile (file1). --makefile <file> create new metafile. -n, --author <text> set text of author (for '--add', '--draft', '--makefile' and '--makepage'). --plugindir <directory> specify weblog's plugin directory. -p, --preview run command to preview weblog. -P, --publish run command to publish weblog. --template <file> specify file to load as template (for '--draft', '--makepage' and '--makefile'). --template-dir <directory> specify weblog's template directory. -t, --title <text> set text of title (for '--add', '--category', '--draft', '--makefile' and '--makepage'). --tag <TAG> specify tag (for '--add', '--draft', '--edit', '--makefile' and '--makepage'). --tag-text <text> set text of tag (for '--tag'). -T, --text <text> set text of body (for '--add', '--draft', '--makefile' and '--makepage'). -U, --update-cache <all,DATE,max,expired> force update of weblog's cache removing specified cached data (defaults to 'expired'). -u, --update <all,DATE,main,max> force update of weblog's files updating specified weblog data (defaults to 'max'). -v, --verbose <1=on/0=off> toggle level of verbosity. -V, --version display version information. -c,-d,-e,-m accepts multiple ID numbers separated by commas (e.g. 1,2,3). --list and --update can match entries by date (irrelevant of entry id(s)). date = YYYY-MM-DD, YYYY-MM, YYYY EXAMPLES
--blogdir [myblog_dir] --add Where myblog_dir is a nonexistent directory. This will create a new directory, copy the default files over, and then let you edit the weblog's configuration. Multiple weblogs can be created this way. Running the same command again on an existing weblog direc- tory will add a new entry. --blogdir [myblog_dir] --configure -u all This opens blog.conf from the weblog directory for editing and updates the entire weblog. [-b blog_dir] -a Add a new entry [-b blog_dir] -c 1 -a Add a new entry to a category [-b blog_dir] -t "New Entry" -n [entry_author] -a Set title and author for new entry [-b blog_dir] -t "New Entry" -n [entry_author] -M "My message." -a Set title, author, and body for new entry [-b blog_dir] -l List current entries [-b blog_dir] -l all List all entries [-b blog_dir] -c 1 -l List entries for a category [-b blog_dir] -e 1 Edit the last entry created [-b blog_dir] -c 1 -e 1 Edit an entry from a category [-b blog_dir] -e 1,2,3 Edit multiple entries [-b blog_dir] -c 1 -m 1 Move an entry to a category [-b blog_dir] -c 1,2,3 -m 1 Move an entry to multiple categories [-b blog_dir] -c 1 -m 1,2,3 Move multiple entries to a category [-b blog_dir] -d 1 Permanently delete an entry [-b blog_dir] -d 1,2,3 Permanently delete multiple entries [-b blog_dir] -c 1 -d 1 Delete an entry from a category [-b blog_dir] -c new -a Create a new category [-b blog_dir] -t "New Category" -c new -a Set the title for a new category [-b blog_dir] -l cat List available categories [-b blog_dir] -c 1 -t "News" -e cat Edit a category's title [-b blog_dir] -c 1 -d cat Delete a category [-b blog_dir] -u all Update the Weblog's Data Directory NOTES
The articles plugin provides a simple way for NanoBlogger to automatically generate and update articles for your weblog. Creating a new article is easy, create a new file in the articles directory and save it with the suffix, "txt". To remove an article simply rename it's suffix to something other than "txt" or remove it from the articles directory. Edit templates/main_links.htm to add new links. FILES
/etc/nanoblogger/nb.conf AUTHOR
NanoBlogger written by Kevin Wood (n1xt3r) <un1xt3r@fastmail.fm> This manual page was originally written by William Vera <billy@billy.com.mx> and then updated by Michal Cihar <michal@cihar.com> 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 Free Documentation SEE ALSO
/usr/share/doc/nanoblogger/nanoblogger.html http://nanoblogger.sourceforge.net/ NanoBlogger 3.3 September 2006 NANOBLOGGER(1)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy