Sponsored Content
Top Forums Shell Programming and Scripting awk throws makes too many open files Post 302913790 by Akshay Hegde on Wednesday 20th of August 2014 12:58:06 AM
Old 08-20-2014
Quote:
Originally Posted by Krrishv
@Akshay,

Thank you so much . I am trying to do this in Shell. When i use the curl command and keeping firstname:"$f1" i am not getting the variable assigned properly. But when i do echo $f1 it prints be proper value. Any clue why curl is not taking the below below is my script.

Code:
!/bin/bash
IFS=","
while read f1 f2 f3 f4
do
echo "line is" :  "$f4"
        #Create user with credentials



(curl -v -H "Authorization: SSWS 00PM9livMo9jIpji"  -H "Accept: application/json"  -H "Content-Type: application/json"  -X POST "https://test.test.com/api/v1/users?activate=false"  -d  '{  "profile": { "firstName": "$f1" ,  "lastName": "$f2" ,  "email": "$f3", "login": "$f4" } }')

echo $f1 $f2 $f3 $f4

done< /Users/kn/Downloads/test1.csv
~

Problem is with single quote replace it with double quotes..

Code:
-d  "{  'profile': { 'firstName': '$f1' ,  'lastName': '$f2' ,  'email': '$f3', 'login': '$f4' } }"


Last edited by Akshay Hegde; 08-20-2014 at 02:04 AM..
 

7 More Discussions You Might Find Interesting

1. Forum Support Area for Unregistered Users & Account Problems

Search throws a wobbly

Dear Administrator, Rule No.5 for unregistered users is impossible to comply with because Google search thinks that any Unix command that I search for is an attack from a virus and blocks the search. I managed to find this site from an external search, and it looks really useful. Do you... (2 Replies)
Discussion started by: Ken N
2 Replies

2. UNIX for Dummies Questions & Answers

scp throws error

My script is like STAMP=$(perl -e '($ss, $mm, $hh, $DD, $MM, $YY) = localtime(time() - 100); printf "%04d%02d%02d%02d%02d", $YY + 1900, $MM + 1, $DD, $hh, $mm') touch $STAMP /sasdata/copydata/ find /sasdata/copydata -type f ! -newer /sasdata/copydata/ -print > output3.txt awk '{print "scp ... (6 Replies)
Discussion started by: tushar_spatil
6 Replies

3. Shell Programming and Scripting

awk script throws invalid char expression

Hello there, I am new to the awk scripting and getting the following error while running the script. Please can you advise me how to resolve this . Thanks ./sub_del_awk_lat.sh awk: cmd. line:5: warning: escape sequence `\/' treated as plain `/' awk: cmd. line:5: sed -n... (6 Replies)
Discussion started by: Sudhakar333
6 Replies

4. Shell Programming and Scripting

Calling shell script within awk script throws error

I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies

5. Shell Programming and Scripting

awk output yields error: awk:can't open job_name (Autosys)

Good evening, Im newbie at unix specially with awk From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example 1. This is the inputfile: $ more MapaRep.txt ds_extra_nikira_usuarios... (18 Replies)
Discussion started by: alexcol
18 Replies

6. Shell Programming and Scripting

awk date too many open files

Dear Community; I have a csv file with msb and lsb in $3 and $5 fields which provides the epochtime (factor 65536). Further I need to convert epochtime to readable datetime. But am getting an error. File Sample: 5000a,1000,20671,0,16421,0,1,NULL,0 5000b,1000,20974,0,-16284,0,1,NULL,0... (4 Replies)
Discussion started by: mystition
4 Replies

7. Shell Programming and Scripting

awk (Too many open files)

Hi Team, This is my first post, hope I am doing it right. I have a large file, like 6 GB. Its a proxy file so vendor requested to change username from logs for saving the confidentiality of the user. This is the script I created (With the help of Google): awk '{ tmp="echo " $5 " |... (12 Replies)
Discussion started by: tealc
12 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 07:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy