|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Unix script question, passing parameters to a script
I call the code below as follows:
testscript.sh part1 when it runs: It prints: parameter is part1 But in perl line it doesnt replace $1 with part1, any ideas? #!/usr/bin/ksh perl -le 'print join("\n", grep {((stat($_))[7] ne "0")}<$1*>)' print "parameter is $1" |
|
#2
|
|||
|
|||
|
that's because it's in single quotes; you probably want to leave it out of the single quotes:
Code:
#!/usr/bin/ksh
perl -le 'print join("\n", grep {((stat($_))[7] ne "0")}<'$1'*>)'
print "parameter is $1"
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Unix script question, passing parameters to a script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|