10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
#!/bin/awk -f
BEGIN {
FS=":";
}
{
if ( $7 == "" ) {
print $1 ": no password!";
}
}
I want to execute this program for a particular user to check for his password from the file /etc/passwd (as the input file) and the user details to be given... (1 Reply)
Discussion started by: sri.phani
1 Replies
2. UNIX for Dummies Questions & Answers
cat doc | nawk -v da="${date}" '$23>199 {print $0 > "doc"+da+".txt"}'
Every time(need to run every day) i run this, i want to a create a new file "doc_01 Aug.txt".
Basically, i want to create a new file with date appended in it.
The above command is creating a file with name "0".... (4 Replies)
Discussion started by: vagar11
4 Replies
3. UNIX Desktop Questions & Answers
I am trying to write a script using commands to print a sequence of numbers.
However, I can't get jot to recognize what I give it.
Terri$ cat mncmd
echo "m=$1"
echo "n=$2"
$jot $2
Terri$ ./mncmd 1 10
m=1
n=10
./mncmd: line 3: $2: command not found
I've also tried
Terri$ cat... (3 Replies)
Discussion started by: justOne21
3 Replies
4. Shell Programming and Scripting
hi,,,,
I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
Discussion started by: vins_89
2 Replies
5. UNIX for Dummies Questions & Answers
hi, can someone how to accept command line arguments as a variable using in script?
like: ./scriptname arguments
by accept arguments, I can use it in my script?
thx! (1 Reply)
Discussion started by: ikeQ
1 Replies
6. Shell Programming and Scripting
I am trying to pass max as a sommand line argument when I call awk.
Made the modification in the BEGIN but it is not working
I'm getting an error as below:
awk: txsrx.awk:82: (FILENAME=jcd.tx FNR=4161) fatal: cannot open file `40' for reading (No such file or directory)
Somehow it... (2 Replies)
Discussion started by: kristinu
2 Replies
7. Shell Programming and Scripting
Hi,
I wish to use a column, as inputted by a user from command line, for pattern matching.
awk file:
{
if($1 ~ /^8/)
{
print $0> "temp2.csv"
}
}
something like this, but i want '$1' to be any column as selected by the user from command line.
... (1 Reply)
Discussion started by: invinclible0009
1 Replies
8. UNIX for Dummies Questions & Answers
I am working on a script wherein i need the user to enter the Build ID
for eg:the command line will show
enter the build ID
Now on entering the build ID it should be assigned to @ARGV.
How can this be done.? (1 Reply)
Discussion started by: Varghese
1 Replies
9. Shell Programming and Scripting
--------------------------------------------------------------------------------
I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
Discussion started by: skooly5
1 Replies
10. Programming
Hi
How to pass multi line text as a command line argument to a program.
(i.e)
./a.out hi this is sample 0 file1
where
hi this is sample should be stored in argv
0 in argv and so on... (3 Replies)
Discussion started by: bankpro
3 Replies