Sponsored Content
Top Forums Shell Programming and Scripting sed and awk giving error ./sample.sh: line 13: sed: command not found Post 302852771 by satishmallidi on Thursday 12th of September 2013 11:55:46 AM
Old 09-12-2013
sed and awk giving error ./sample.sh: line 13: sed: command not found

These are commands i gave :-
Code:
#!/bin/bash

sed -n '13,$'p /opt/sat/inp/sampledata.txt > /opt/sat/inp/sample2.txt

awk '{print $5}' /opt/sat/inp/sample2.txt > /opt/sat/inp/sample3.txt

regards,
satish

Last edited by Scott; 09-12-2013 at 12:56 PM.. Reason: Code tags again
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change line found by pattern using sed

I want to change a line like CPM_THRESHOLD 0.8 // to a new value using sed I am trying sed -i "s/CPM_THRESHOLD/CPM_THRESHOLD\t$COH\t\t\/\//" $INPUT_4 but how can i substitute the whole line begining with CPM_THRESHOLD and substitute it? (2 Replies)
Discussion started by: larne
2 Replies

2. Shell Programming and Scripting

Loop with sed command to replace line with sed command in it

Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line. ... (1 Reply)
Discussion started by: cbo0485
1 Replies

3. UNIX for Dummies Questions & Answers

error in line 6 command not found

#!/bin/bash dir=/home/andre/Documents/Scripts/Copy1/ f1=file1 f2=file2 f3=file3 check= ( cd $dir && ls | grep file? ) #the idea is to check if files file1-3 exists, has been copied, are there already, whatever :D if ; then mkdir Copy1 echo " has created folder " else echo "... (2 Replies)
Discussion started by: me.
2 Replies

4. Shell Programming and Scripting

sed returns error "sed: -e expression #1, char 18: unterminated `s' command"

Hello All, I have something like below LDC100/rel/prod/libinactrl.a LAA2000/rel/prod/libinactrl.a I want to remove till first forward slash that is outputshould be as below rel/prod/libinactrl.a rel/prod/libinactrl.a How can I do that ??? (8 Replies)
Discussion started by: anand.shah
8 Replies

5. Shell Programming and Scripting

sed -i option giving error no such file or directory

I created a shell with sed -i option. It is giving error - No such file or directory Ex - sed -i 's/yes/no' yes.txt sed -i 's/why/where' yes.txt sed -i 's/when/how' yes.txt Error - :No such file or directory When I run single line in my script say sed -i 's/yes/no' yes.txt... (10 Replies)
Discussion started by: yahoo
10 Replies

6. Shell Programming and Scripting

To add a new line with specific text after the pattern is found using sed

hi guys, im trying to add the following line in my xml file <dbrollbacksegs <oa_var="s_db_rollback_segs">NOROLLBACK</dbrollbacksegs> when ever i find the following line <dbsharedpool oa_var="s_dbsharedpool_size">300000000</dbsharedpool> I have succedded till adding a new line... (1 Reply)
Discussion started by: smarlaku
1 Replies

7. Shell Programming and Scripting

Command line - awk, sed

My input file gfile values is CTRY=GM&PROJTYPE=SP&PROJECTTYPE=Small+Project If i am giving PROJECTTYPE then it must give Small Project awk -F"&" '{for (i=1; i<=NF; i++) if ($i ~ "^"PAT) {sub ("^"PAT"=", "", $i); sed 's/'+'/""/' $i ; print $i }}' PAT=$1 ... (6 Replies)
Discussion started by: nag_sathi
6 Replies

8. Shell Programming and Scripting

sed command throwing error while deleting a line from a file

Hi all, I ahve a program which has to delete a line in a file... if i run the sed command through shell prompt it works fine. But if run it using code its throwing error. May i know where i am doing wrong. the file has 3 lines # cat /root/.ssh/known_hosts... (4 Replies)
Discussion started by: vivek d r
4 Replies

9. Shell Programming and Scripting

Get multi-line sed not to run if regex is found

Hello, everyone. Thanks for taking the time to read my post. I have nagios config files for which I'm adding the custom variable _mac_address. I have a sed script that places this variable into an existing file. The problem I'm having is if a line in the file is commented out, I don't want the... (2 Replies)
Discussion started by: JimBass
2 Replies

10. UNIX for Beginners Questions & Answers

Sed/awk join lines once pattern found

Hi all OS - RHEL6.4 I have input file -f1.txt I need to search line which starts with \Start and read next line till it gets blank line and join them all. I need to trim any trailing spaces for each line.So output.txt should be.. \Start\now\fine stepwatch this space for toolsends... (7 Replies)
Discussion started by: krsnadasa
7 Replies
giiQueryDeviceInfo(3)							GGI						     giiQueryDeviceInfo(3)

NAME
giiQueryDeviceInfo, giiQueryDeviceInfoByNumber - Get information about input sources SYNOPSIS
#include <ggi/gii.h>` int giiQueryDeviceInfo (gii_input_t inp, uint32_t origin, gii_cmddata_getdevinfo *info); int giiQueryDeviceInfoByNumber(gii_input_t inp, uint32_t number, uint32_t *origin, gii_cmddata_getdevinfo *info); DESCRIPTION
Though when using GII inputs the exact type of device is fully transparent to the program, information about the device that is actually attached to a given gii input and origin id can be queried, e.g. for configuration interfaces. For giiQueryDeviceInfo the parameters inp and origin select the input to query. This version is usually used, if you want to identify a device after getting an event from it. For giiQueryDeviceInfoByNumber the parameters inp and number select the input to query - origin gets set to the origin ID the queried device has. This version is used, when you want to query all known devices. The queried data is put into info. See gii_cmddata_getdevinfo(3) for the description of the structure. RETURN VALUE
Returns 0 on success (info is valid, then) or -1 otherwise. SEE ALSO
giiQueryValInfo(3) libgii-1.0.x 2006-12-30 giiQueryDeviceInfo(3)
All times are GMT -4. The time now is 06:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy