10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
mkdir logs
mkdir: Failed to make directory "logs"; File existsTo avoid this error i use the -p argument so it creates a folder only if it is does not exists like you see below.
mkdir -p logs In the similar manner i wish to avoid this error with ln command
ln -s /tmp/myfolder var
ln: cannot... (4 Replies)
Discussion started by: mohtashims
4 Replies
2. Shell Programming and Scripting
Hi,
I am using awk here.
Inside an awk script, I have a variable which contains a very long XML data in string format (500kb).
I want to pass this data (as argument) to curl command using system function.
But getting Too many arguments error due to length of string data(payloadBlock).
I... (4 Replies)
Discussion started by: cool.aquarian
4 Replies
3. Shell Programming and Scripting
Hi,
I need to set "prd" in the below command to a unix variable
nawk '/^#/ {next} FNR==NR {prd;next} !($0 in prd)'
So, this is what i did
fname=prd // unix shell variable
nawk -v fname=$fname '/^#/ {next} FNR==NR {fname;next} !($0 in fname)'But the value of fname i.e "prd" is not... (8 Replies)
Discussion started by: mohtashims
8 Replies
4. Shell Programming and Scripting
Hi,
I am in critical need of help, Thanks a ton for your help.
I need to know how to pass the shell argument into nawk code in AIX. so that my file gets passed into that awk script and it can execute it part.
To be detail, i have more than 100 files and in those files a particular field... (6 Replies)
Discussion started by: Selva_2507
6 Replies
5. Shell Programming and Scripting
I am using echo in bash. Have created a function prargv which takes a number of arguments.
Example:
prargv "-e" "--examples"
Inside prargv, I want to print all the arguments using echo
echo "$@"
This returns
--examples
rather than
-e --examples"
This problem can be fixed... (3 Replies)
Discussion started by: kristinu
3 Replies
6. Shell Programming and Scripting
hi everobody
kindly consider the following
in tclsh
I understand that we can do the following
%exec UnixCmd arg1 arg2
but if I assinged the arguments to a list insde tclsh how can I use them back
i.e
%set ArgList
%exec UnixCmd
%exec Unixcmd $list
%exec
all the... (1 Reply)
Discussion started by: Blue_shadow
1 Replies
7. Shell Programming and Scripting
Hi friends,
I have small query with reg to awk search pattern..
below is my sample file and code which i tried..
$ cat file.txt
xxx,yyyyy,messageID,sha
xxxx,errorcode,messageID,name
in the above sample file - let assume I know the errorcode(2nd record) using which I want to... (2 Replies)
Discussion started by: Shahul
2 Replies
8. Shell Programming and Scripting
Hello
I have facing issue while using cp command inside nawk block.
#!/bin/ksh
my_name=$1
nawk -v my_name1=$my_name 'BEGIN {
n = split(my_name1,names,":");
for (i=1;i<=n;i++)
{
print names;
cpcmd = "cp " /tmp/test.txt" " ./sample
system(cpcmd)
}
exit
}'
exit 0
i'am getting... (1 Reply)
Discussion started by: piscean_n
1 Replies
9. Shell Programming and Scripting
well I found lot of topics about awk..about if command in awk..
but I had to implement this:
nawk -F"|" '
$47 ~ /0R0011/ { print > ("/home/user/M/MC.tmp" )}
$47 ~ /0R0012/ { print > ("/home/user/M/DuSI.tmp" )}
$47 ~ /0R0014/ { print > ("/home/user/M/FF.tmp" )}
$47 ~ /0R0018/ { print >... (9 Replies)
Discussion started by: abdulaziz
9 Replies
10. Shell Programming and Scripting
Can someone help me to understand this part of code?
/bin/nawk -f awkfile file1 file2
I know awkfile is the one with awk script.
file1 is source file that needs to be processed.
What is file2 two?
Thanks for your help! (4 Replies)
Discussion started by: whatisthis
4 Replies