Sponsored Content
Top Forums Shell Programming and Scripting Problems editing file with awk in bash script Post 302501716 by homeboy on Friday 4th of March 2011 10:57:27 AM
Old 03-04-2011
do you mean this?
Code:
awk 'BEGIN{FS="[=,]"}{printf $1",";for(i=5;i<=18;i++) printf "%s,",$i}' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File editing using awk

Hi All, I have a file, say test.dat which is "|" separated. It has 50K records in it. One of the field in the file has the data in the format 'mm/dd/yyyy'. I need to edit the file by changing the format to 'yyyy/mm/dd' in the same field where as the rest of the data remain untouched. Please... (2 Replies)
Discussion started by: rinku11
2 Replies

2. Shell Programming and Scripting

Editing the File using Awk

I have input file that is having below text 098769 178902 234678 I want to modify the input file like below. '098769', '178902', '234678' Can you please help to get this. I tried but i am not getting this. (3 Replies)
Discussion started by: awk_beginner
3 Replies

3. Shell Programming and Scripting

Editing File using awk/sed

Hello Awk Gurus, Can anyone of you help me with the below problem. I have got a file having data in below format pmFaultyTransportBlocks ----------------------- 9842993 pmFrmNoOfDiscRachFrames ----------------------- NULL pmNoRecRandomAccSuccess -----------------------... (4 Replies)
Discussion started by: Mohammed
4 Replies

4. UNIX for Dummies Questions & Answers

Pls help me with file editing using awk

Hi all, Pls help me with file editing using awk. I have a text file with the below format. "STANDARD VOLUME ","2009","BUX","V","JCBH49","NF", 001413 "VENDOR MATERIAL-STD ","2009","BUX","V","JCBH49","NF", 009948 "INBOUND TRANS-STD ... (2 Replies)
Discussion started by: srinivas.maddy
2 Replies

5. Web Development

bash script editing my apache config files

okay i'm going to try to say this uber-simple: I use dropbox (file-sync service). in order for dropbox sync files, they must be its children eg. somewhere under /home/jzacsh/Dropbox]. I want to now use it to keep my development files in sync across my machines: easy: just move my dev. files... (2 Replies)
Discussion started by: jzacsh
2 Replies

6. Shell Programming and Scripting

Execution Problems with bash script

Hello, can someone please help me to fix this script, I have a 2 files, one file has hostname information and second file has console information of the hosts in each line, I have written a script which actually reads each line in hostname file and should grep in the console file and paste the... (8 Replies)
Discussion started by: bobby320
8 Replies

7. Shell Programming and Scripting

Execution problems with BASH Shell Script

Hi I need help with my coding , first time I'm working with bash . What i must do is check if there is 3 .txt files if there is not 3 of them i must give an error code , if al three is there i must first arrange them in alphabetical order and then take the last word in al 3 of the .txt files... (1 Reply)
Discussion started by: linux newb
1 Replies

8. Shell Programming and Scripting

editing file with awk cut and sed

HI All, I am new to unix. I have a file would like to do some editing by using awk, cut and sed. Could anyone help? This file contain 100 lines. There are one line for example: 2,"102343454",5060,"579668","579668","579668","SIP",,,"825922","035885221283026",1,268,"00:59:00.782 APR 17... (2 Replies)
Discussion started by: mimilaw
2 Replies

9. Shell Programming and Scripting

Parsing and Editing a json file with bash script

I am trying to automate editing of a json file using bash script. The file I initially receive is { "appMap": { "URL1": { "name": "a" }, "URL2": { "name": "b" }, "URL3": { "name": "c" }, } WHat I would like to do is replace... (5 Replies)
Discussion started by: Junaid Subhani
5 Replies

10. Shell Programming and Scripting

sed problems - Bash Script

Hi I keep getting the following error sed: -e expression #1, char 32: unterminated `s' command sed: -e expression #1, char 35: unterminated `s' command sed: -e expression #1, char 35: unterminated `s' command whenever I use the following bash script #! /bin/bash... (2 Replies)
Discussion started by: spbr
2 Replies
RBASH(1)						      General Commands Manual							  RBASH(1)

NAME
rbash - restricted bash, see bash(1) RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at invocation, the shell becomes restricted. A restricted shell is used to set up an environment more controlled than the standard shell. It behaves identically to bash with the exception that the follow- ing are disallowed or not performed: o changing directories with cd o setting or unsetting the values of SHELL, PATH, ENV, or BASH_ENV o specifying command names containing / o specifying a file name containing a / as an argument to the . builtin command o specifying a filename containing a slash as an argument to the -p option to the hash builtin command o importing function definitions from the shell environment at startup o parsing the value of SHELLOPTS from the shell environment at startup o redirecting output using the >, >|, <>, >&, &>, and >> redirection operators o using the exec builtin command to replace the shell with another command o adding or deleting builtin commands with the -f and -d options to the enable builtin command o using the enable builtin command to enable disabled shell builtins o specifying the -p option to the command builtin command o turning off restricted mode with set +r or set +o restricted. These restrictions are enforced after any startup files are read. When a command that is found to be a shell script is executed, rbash turns off any restrictions in the shell spawned to execute the script. SEE ALSO
bash(1) GNU Bash-4.0 2004 Apr 20 RBASH(1)
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy